Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

`useFindAndModify` is an invalid option.

//***** It's a deprecated now. // No longer necessary: *******

mongoose.set('useFindAndModify', false); //No longer necessary
await mongoose.connect('mongodb://localhost:27017/test', {
  useNewUrlParser: true, // <-- no longer necessary
  useUnifiedTopology: true // <-- no longer necessary
});

// ********************  use this line of code  ************
mongoose.connect(CONNECTION_URL).then(()=>{console.log('...')})
//read more: https://mongoosejs.com/docs/migrating_to_6.html#mongoose-connect-returns-a-promise
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #invalid
ADD COMMENT
Topic
Name
2+2 =