[DOCS-5040] updateRole does not support specifying a role with the database Created: 17/Mar/15  Updated: 30/Oct/23  Resolved: 17/Mar/15

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Minor - P4
Reporter: Marcin Chady Assignee: Michael Paik
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mongod 2.6.6

Location: http://docs.mongodb.org/manual/reference/command/updateRole/#dbcmd.updateRole
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36
Referrer: http://docs.mongodb.org/manual/reference/command/
Screen Resolution: 1024 x 1280
repo: docs
source: reference/command/updateRole


Participants:
Days since reply: 7 years, 29 weeks ago

 Description   

When I try this command:
db.runCommand({updateRole:

{role:"QA", db:"PLSProduction"}

, ...

I get this error:

{ "ok" : 0, "errmsg" : "\"updateRole\" had the wrong type. Expected String, found Object", "code" : 14 }

Reporter: Marcin Chady
E-mail: marcin@digitalscapes.ca



 Comments   
Comment by Emily Hall [ 27/Jul/16 ]

Closed for housekeeping on 7/27/2016 by Emily Hall.
If you require additional support, please open a new ticket for prioritization.
Thanks,
Emily

Comment by Michael Paik [ 17/Mar/15 ]

This syntax is incorrect. The argument to "updateRole" must be a string naming a role currently in the database you are currently using (e.g. "use admin").

The

{role:"string", db:"string"}

format is only valid for the "roles" parameter, as in the example on the page:

     roles:
         [
           { role: "dbAdminAnyDatabase", db: "admin" }
         ],

Please refer to the support page for community support options.

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