|
Thank you for filing a DOCS ticket.
I was not able to reproduce your issue on MongoDB 3.2.10. addUser() is deprecated, and db.createUser() is the correct method for adding a user to a database.
> use admin
|
switched to db admin
|
> db.createUser(
|
... {
|
... user: "myUserAdmin",
|
... pwd: "abc123",
|
... roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
|
... }
|
... )
|
Successfully added user: {
|
"user" : "myUserAdmin",
|
"roles" : [
|
{
|
"role" : "userAdminAnyDatabase",
|
"db" : "admin"
|
}
|
]
|
}
|
> db.getUsers()
|
[
|
{
|
"_id" : "admin.myUserAdmin",
|
"user" : "myUserAdmin",
|
"db" : "admin",
|
"roles" : [
|
{
|
"role" : "userAdminAnyDatabase",
|
"db" : "admin"
|
}
|
]
|
}
|
]
|
I was then able to follow the steps in the tutorial to restart the mongod with authentication enabled and auth as the user.
Please create a post on the MongoDB Google Group for support. Depending on the outcome of your support ticket, more specific documentation improvements may be possible.
|