ramiel / mongoose-sequence

Sequence and autoincrement handling for mongoose
GNU General Public License v2.0
284 stars 56 forks source link

Remove DeprecationWarning #113

Closed anhdiepmmk closed 3 years ago

anhdiepmmk commented 3 years ago

(node:27860) DeprecationWarning: Mongoose: findOneAndUpdate() and findOneAndDelete() without the useFindAndModify option set to false are deprecated. See: https://mongoosejs.com/docs/deprecations.html#findandmodify

ramiel commented 3 years ago

This is up to you to set

mongoose.set('useFindAndModify', false);

or

mongoose.connect(uri, { useFindAndModify: false });

on mongoose instance