TypeError: db.addUser is not a function : @(shell):1:1 ——mongoDB创建新用户名密码的方法...
生活随笔
收集整理的这篇文章主要介绍了
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" } ]
}
)
转载于:https://www.cnblogs.com/wzlblog/p/6371069.html
总结
以上是生活随笔为你收集整理的TypeError: db.addUser is not a function : @(shell):1:1 ——mongoDB创建新用户名密码的方法...的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 【Electron】Electron开发
- 下一篇: TP框架中的A方法和R方法