Implemented the first half of mongoDB functionality