connect to mongodb, select a database and a collection