[DOCS-6296] Comment on: "manual/tutorial/add-user-administrator.txt" Created: 29/Sep/15  Updated: 03/Nov/17  Resolved: 01/Oct/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:

Location: http://docs.mongodb.org/v2.4/tutorial/add-user-administrator/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36
Referrer: http://docs.mongodb.org/v2.4/tutorial/enable-authentication/
Screen Resolution: 1440 x 900
repo: docs
source: tutorial/add-user-administrator


Participants:
Days since reply: 8 years, 20 weeks ago

 Description   

mongos> use admin
switched to db admin
mongos> db.addUser(

{user: "root", pwd: "test it out", roles: ["userAdminAnyDatabase" ] }

)
2015-09-29T20:51:59.328+0000 E QUERY TypeError: Property 'addUser' of object admin is not a function
at (shell):1:4
mongos>



 Comments   
Comment by Kay Kim (Inactive) [ 01/Oct/15 ]

Not sure which version of MongoDB the reporter is using – but using MongoDB 2.4, am able to create user

launching: ./mongodb-2.4.14/bin/mongos on port 27017
adding shards. can take up to 30 seconds...
MongoDB shell version: 2.4.14
connecting to: test
mongos> use admin
switched to db admin
mongos> db.addUser(
... {user: "root", pwd: "test it out", roles: ["userAdminAnyDatabase" ] } )
{
	"user" : "root",
	"pwd" : "cfbd30796397e482a67dfd4f56be39d3",
	"roles" : [
		"userAdminAnyDatabase"
	],
	"_id" : ObjectId("560cb0a71143876c5450c3db")
}

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