我正在使用 mongoose 和 mocha 进行 MongoDB 模式设计和 API 开发
我收到此警告...
这是什么意思,它将如何影响我以及修复方法是什么?
在实际警告文本下方:
(node:9872) DeprecationWarning: Listening to events on the Db class has been deprecated and will be removed in the next major version.
最佳答案
更新
mongodb@3.6.5出来了。
只需更新 mongodb 驱动程序和 Mongoose :
npm i mongodb mongoose
这是由 mongodb@3.6.4 native driver 引起的这是 Mongoose 使用的。
#1 您可以将 mongodb 降级到版本 3.6.3 ( described here )。
#2 或者将 mongoose 从 5.11.16 降级回 5.11.15:
npm uninstall mongoose
npm install mongoose@5.11.15
#3 或者就等mongodb@3.6.5的发布吧。
关于node.js - 弃用警告 : Listening to events on the Db class has been deprecated and will be removed in the next major version,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66190532/