[DOCS-6839] Comment on: "manual/reference/method/db.updateUser.txt" Created: 17/Dec/15  Updated: 03/Nov/17  Resolved: 17/Dec/15

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Bug Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Kay Kim (Inactive)
Resolution: Cannot Reproduce Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mongo ReplicaSet (Primary-Secondary and Arbiter) in Debian 8 64 bits

Location: https://docs.mongodb.org/v3.0/reference/method/db.updateUser/
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36
Referrer: https://www.google.es/
Screen Resolution: 1366 x 768
repo: docs
source: reference/method/db.updateUser


Participants:
Days since reply: 8 years, 8 weeks, 6 days ago

 Description   

It doesn't work in Mongo 3.0.7. Obtaining the following error message:

abc:PRIMARY> db.grantRolesToUser( "user123", [

{ role: "read", db: "datadb" }

] )
2015-12-17T17:25:46.690+0100 E QUERY Error: Could not find user user123@admin
at Error (<anonymous>)
at DB.grantRolesToUser (src/mongo/shell/db.js:1298:15)
at (shell):1:4 at src/mongo/shell/db.js:1298



 Comments   
Comment by Kay Kim (Inactive) [ 17/Dec/15 ]

Emailed user directly explaining the distinction between authenticationDB and where MongoDB stores user information.
replset:PRIMARY> db.createUser(

{ user: "user123", pwd: "abc123", roles: [] }

)
Successfully added user:

{ "user" : "user123", "roles" : [ ] }

replset:PRIMARY> db.grantRolesToUser( "user123", [
...

{ role: "read", db: "datadb" }

... ] )
replset:PRIMARY>

Generated at Thu Feb 08 07:53:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.