我只是想创建一个API,并在我的应用程序中连接到它.js文件,但每次我运行应用程序.js我收到了这个弃用警告.我已经判断了mongoose和MongoDB中的所有弃用警告,但我找不到任何与我的相匹配的警告.我得到的警告是,

(node:16864) Warning: Accessing non-existent property 'MongoError' of module exports inside circular dependency

(Use node --trace-warnings ... to show where the warning was created)

(node:16864) DeprecationWarning: Listening to events on the Db class has been deprecated and will be removed in the next major version.

为什么我会收到这个弃用警告?我如何才能删除它?

推荐答案

我猜这个警告是在mongoose 5.11.16版本中出现的.如果你想在bug修复之前避免看到它们,你可以 Select mongoose 5.11.15版.卸载mongoose 5.11.16并安装npm install mongoose@5.11.15

Mongodb相关问答推荐

MongoDB$unionWith,如何 Select 特定文档

使用MongoDB 4将根文档替换为数组

我无法在react 中使用 fetch 和express 从数据库中删除数据

MongoDB 聚合 - 条件 $lookup 取决于字段是否存在

使用golang中的过滤器从mongodb复合集合中获取所有数据

从 kubectl exec 获取返回值到 powershell 脚本

MongoDb c# driver LINQ vs Native 查询

解析命令行时出错:unrecognized option --rest

如何在 MongoDB 中存储时间?作为字符串?给出任意年/月/日?

在 Heroku 上使用 Node 读取、写入和存储 JSON

使用 MongoDB 进行分页

Mongoose:填充填充字段

有没有办法为 mongoose.js 聚合提供 allowDiskUse 选项?

具有简单密码认证的 MongoDB 副本集

在 MongoDB 上分片 GridFS

Java Mongodb 正则表达式查询

使用 mongodb 在数组中查找子文档

通过浏览器连接mongodb?

如何在 Ubuntu 10.04 中使用 --auth 选项重新启动 mongodb?

带有条件的MongoDB聚合查找