Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

`useFindAndModify` is an invalid option.


mongoose.set('useFindAndModify', false);

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

Comment

`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
Comment

PREVIOUS NEXT
Code Example
Javascript :: node fs full path 
Javascript :: import all from javascript 
Javascript :: node js get time in timezone 
Javascript :: nodejs fs delete non empty directory 
Javascript :: nesting in react js 
Javascript :: next js back to previous page 
Javascript :: how to load image from dir nodejs 
Javascript :: value change event jquery 
Javascript :: how to show 1 day ago in javascript 
Javascript :: function palindrome javascript 
Javascript :: angular loop 
Javascript :: get all cookies 
Javascript :: insert into array js 
Javascript :: disable key enter react-hook-form 
Javascript :: upload file in react 
Javascript :: express request body undefined 
Javascript :: javascript compare number to string 
Javascript :: set property dom javascrpt 
Javascript :: if not undefined javascript 
Javascript :: settimeout vs requestanimationframe 
Javascript :: append a query string to the url react 
Javascript :: set label text in jquery 
Javascript :: js capitalize first letter 
Javascript :: mongoose increment sub document 
Javascript :: how to check all values of an array are equal or not in javascript 
Javascript :: how to know if a number has a decimal number js 
Javascript :: How to Use the toUpperCase() String Method in javascript 
Javascript :: npm react dom routing 
Javascript :: onclick toggle class react 
Javascript :: jquery add div 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =