Docs page for how to fix deprecation warnings
See original GitHub issueAfter #6917 it should now be possible to clear up all deprecation warnings by:
- Replacing
update()
withupdateOne()
,updateMany()
, orreplaceOne()
- Replacing
remove()
withdeleteOne()
ordeleteMany()
- Setting
mongoose.set('useFindAndModify', false);
- Setting
mongoose.set('useCreateIndex', true);
- Setting
mongoose.set('useNewUrlParser', true);
Need a docs page to summarize this.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:31
- Comments:31 (4 by maintainers)
Top Results From Across the Web
Warning Uses Deprecated APIs - Google Chrome Community
I got warning on PageSpeed because of Uses deprecated APIs. I searched on their page but I can't find which part I have...
Read more >Deprecating Content - Read the Docs
Deprecating content may sound as easy as delete it, but doing that will break existing links, and you don't necessary want to make...
Read more >Enhanced Deprecation - Java - Oracle Help Center
The javadoc tool generates a page named deprecated-list.html which contains the list of deprecated APIs, and adds a link in the navigation bar...
Read more >warnings — Warning control — Python 3.11.1 documentation
Base category for warnings about features that will be deprecated in the future (ignored by default). ImportWarning. Base category for warnings triggered during ......
Read more >Mongoose v6.8.1: Deprecation Warnings
DeprecationWarning: collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead. To remove this deprecation warning, replace any usage of ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I believe it is
mongoose.set('useCreateIndex', true)
I set
mongoose.set('useCreateIndexes', true)
and still getDeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead
.I’ve tried it before and after
mongoose.connect()
.