启动egg-mongoose出现警告

启动egg-mongoose出现警告

(node:37366) [MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.

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

(node:37366) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.


在启动时,如何消除这个两个警告

正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
张轩 2022-10-13 09:23:24

同学你好

这个问题是 egg-mongoose 里面的启动服务的时候没有传递特定参数导致的,也就是说新版的 mongoose 初始化的时候建议添加特定参数,这个必须等 egg-mongoose 进行更新了,或者可以不用它的插件,自己 fork 一个类似的,然后将参数加上即可。

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师