Answers for "DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead. Connected to database succesfully"

3

(node:2496) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.

/*As of this edit, Mongoose is now at v5.4.13. Per their docs, these are the fixes for the deprecation warnings..*/
mongoose.set('useNewUrlParser', true);
mongoose.set('useFindAndModify', false);
mongoose.set('useCreateIndex', true);
Posted by: Guest on July-06-2020
3

(node:2496) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.

mongoose.set('useNewUrlParser', true);
mongoose.set('useFindAndModify', false);
mongoose.set('useCreateIndex', true);
Posted by: Guest on July-06-2020

Code answers related to "DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead. Connected to database succesfully"

Code answers related to "Javascript"

Browse Popular Code Answers by Language