3
我试图与下面的连接字符串authSource在mongo数据库url中意味着什么?
var Mongo_url = 'mongodb://MyUSer:[email protected]:27017/chatme?authSource=admin';
我得到错误的
assertionError: null == { [MongoError: Authentication failed.]
name: 'MongoError',
message: 'Authentication failed.',
ok: 0,
code: 18,
任何人都可以请清除此“authSource = admin”的东西给我连接到我的蒙戈数据库。
我有我的用户在system.users集合。所以根据你的'authSource = admin'应该用authSource = users替换。对?? –
不,这是数据库的名称,而不是集合。它默认为您尝试连接的数据库。它没有参数工作吗? – Thilo
是的,它没有参数。我现在明白了。谢谢 –