Answers for "`findOneAndUpdate()` and `findOneAndDelete()` without the `useFindAndModify` opt"

2

DeprecationWarning: current Server Discovery and Monitoring engine is deprecated,

mongoose.connect(uri, { useNewUrlParser: true,useUnifiedTopology:true });
mongoose.createConnection(uri, { useNewUrlParser: true });
Posted by: Guest on November-03-2020
0

https://mongoosejs.com/docs/deprecations.html#findandmodify

// Make Mongoose use `findOneAndUpdate()`. Note that this option is `true`
// by default, you need to set it to false.
mongoose.set('useFindAndModify', false);
Posted by: Guest on June-24-2020

Code answers related to "`findOneAndUpdate()` and `findOneAndDelete()` without the `useFindAndModify` opt"

Browse Popular Code Answers by Language