Mongoose解决MongoDB弃用警告(DeprecationWarning)

react项目启动mongodb时,提示如下错误:

DeprecationWarning: Mongoose: `findOneAndUpdate()` and `findOneAndDelete()` without the `useFindAndModify` option set to false are deprecated. See: https://mongoosejs.com/docs/deprecations.html#-findandmodify-
DeprecationWarning: collection.findAndModify is deprecated. Use findOneAndUpdate, findOneAndReplace or findOneAndDelete instead.

找到了这个地址,解决了,现拿来收藏:https://blog.csdn.net/qq_42760049/article/details/98593923?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2

解决方法:
Mongoose解决MongoDB弃用警告(DeprecationWarning)

Mongoose解决MongoDB弃用警告(DeprecationWarning)

上一篇:mysql高可用方案


下一篇:js实现多个滑动门在同一个页面展示效果