输入banner图图片脚本导航/分类

TypeError: db.addUser is not a function : @(shell):1:1 ——mongoDB创建新用户名密码的方法

不多说,旧版本使用

db.addUser("root","root")

新版本使用这句会出现这个错误提示

TypeError: db.addUser is not a function : @(shell):1:1

新版本用的是

 db.createUser(
  {
    user: "test",
    pwd: "test",
    roles: [ { role: "userAdmin", db: "test" } ]
  }
) 技术分享图片

TypeError: db.addUser is not a function : @(shell):1:1 ——mongoDB创建新用户名密码的方法

标签:nbsp   class   技术分享   info   创建   bsp   pos   mongo   div