Adapted to MongoDb