Mongo添加username&password
[url]https://www.asni.cn/1357[/url]
官网API查询
[url]https://docs.mongodb.com/manual/reference/method/db.createUser/[/url]
[url]https://www.asni.cn/1357[/url]
官网API查询
[url]https://docs.mongodb.com/manual/reference/method/db.createUser/[/url]
use testdb
db.createUser(
{
user: "kelvin",
pwd: "kelvin",
roles: [ "readWrite", "dbAdmin" ]
}
)