communication with mongodb