// Make Mongoose use `findOneAndUpdate()`. Note that this option is `true` // by default, you need to set it to false. mongoose.set('useFindAndModify', false);