MongoDB已将属性'auth'设置为true,在commond行中,您必须先登录Admin,然后才能操作其他数据库 .

在nodejs中,我写了这样的连接:

mongoose.connect('mongodb://用户名:pwd@127.0.0.1:27017 / test');

但它失败了,我是否需要首先连接Admin,如果是这样,怎么样?