mongoose findByIdAndUpdate model code example
Example 1: findbyidandupdate return old value
Model.findByIdAndUpdate(id, updateObj, {new: true}, function(err, model) {...
Example 2: mongoose model
const schema = new mongoose.Schema({ name: 'string', size: 'string' });
const Tank = mongoose.model('Tank', schema);