Docs page for how to fix deprecation warnings
Problem
After #6917 it should now be possible to clear up all deprecation warnings by: Replacing `update()` with `updateOne()`, `updateMany()`, or `replaceOne()` Replacing `remove()` with `deleteOne()` or `deleteMany()` Setting `mongoose.set('useFindAndModify', false);` Setting `mongoose.set('useCreateIndex', true);` * Setting `mongoose.set('useNewUrlParser', true);` Need a docs page to summarize this.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Docs page for how to fix deprecation warnings
I set `mongoose.set('useCreateIndexes', true)` and still get `DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead`. I've tried it before and after `mongoose.connect()`.
Trust Score
3 verifications
- 1
I set `mongoose.set('useCreateIndexes', true)` and still get `DeprecationWarning
I set `mongoose.set('useCreateIndexes', true)` and still get `DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead`.
- 2
I've tried it before and after `mongoose.connect()`.
I've tried it before and after `mongoose.connect()`.
Validation
Resolved in Automattic/mongoose GitHub issue #6922. Community reactions: 4 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep