javascript - mongodb线上环境报错Db.prototype.authenticate method will...

查看:177
本文介绍了javascript - mongodb线上环境报错Db.prototype.authenticate method will...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

项目部署到阿里云服务器ubuntu14.04时会发生一次重启,看日志说
Db.prototype.authenticate method will no longer be available in the next major release 3.x as MongoDB 3.6 will only allow auth against users in the admin db and will no longer allow multiple credentials on a socket. Please authenticate using MongoClient.connect with auth credentials.
我在这里看到有人遇到同样的问题 https://github.com/Automattic...,说是mongoose的原因,我把mongoose升级到最新版本后还是报这个错。。。
这是我连mongodb的链接:

mongodb://blog_runner:safeblog@127.0.0.1:27017/blog-app

blog_runner是具有读写权限的。如何解决呢?

解决方案

是与mongoose的版本有关系,我用4.7.0是没有这个提示的,升级到最新4.10.6就提示了

这篇关于javascript - mongodb线上环境报错Db.prototype.authenticate method will...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆