Implemented mongoDB functionality