Added function for mongo.