update Mongo code