Alter code for new changes in MongoDb