You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(node:10816) DeprecationWarning: Mongoose: `findOneAndUpdate()` and `findOneAndDelete()` without the `useFindAndModify` option set to false are deprecated. See: https://mongoosejs.com/docs/deprecations.html#findandmodify
What I would expect:
for the error message to tell me which commands to use, rather than suggesting setting an option to false. I imagine the people who decided to deprecate a command had reasons to do so; I'm starting out using this technology and I'd like to know how I'm supposed to use it. Setting an option to false sounds like sweeping the issue under the carpet.
the linked page does not clearly state what is deprecated and what is supposed to be the replacement
The text was updated successfully, but these errors were encountered:
// Make Mongoose use `findOneAndUpdate()`. Note that this option is `true`// by default, you need to set it to false.mongoose.set('useFindAndModify',false);
Admittedly this is a case of sweeping an issue under the carpet: Mongoose's findOneAndUpdate() method was originally written as a helper that uses findAndModify() under the hood, but then the MongoDB driver introduced its own findOneAndUpdate() function, so we're trying to transition to using their findOneAndUpdate() while minimizing the risk of breaking changes. Sorry for the inconvenience and thanks for your patience 👍
vkarpov15
added
help
This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
and removed
developer-experience
This issue improves error messages, debugging, or reporting
labels
Apr 23, 2021
vkarpov15
added
docs
This issue is due to a mistake or omission in the mongoosejs.com documentation
and removed
help
This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
labels
Apr 27, 2021
I get the following deprecated error:
What I would expect:
The text was updated successfully, but these errors were encountered: