update method for mongo