db.addUser( "guest", "pass", { readOnly: true } )
Please run the "db.system.users.find()" command in the mongo shell and let me know the results.
It looks like you are using MongoDB version 2.4 with the addUser() syntax for version 2.2.
> db.system.users.find()
> db.system.users.find()
There seems to be two different syntaxes for the db.addUser() command.
db.addUser("<username>", "<password>", true)
2. http://docs.mongodb.org/v2.2/reference/method/db.addUser/
db.addUser("user1" , "pass" , { readOnly : true } )
The document structure for these two syntaxes is different. Please see the attached "Issue8848" screenshot. "user1" is created using syntax 1 and "user2" using syntax 2.
The SHOW USERS command returns READ permission for "user1" but "READWRITE" permission for "user2".
There seems to be two different syntaxes for the db.addUser() command.
db.addUser("<username>", "<password>", true)
2. http://docs.mongodb.org/v2.2/reference/method/db.addUser/
db.addUser("user1" , "pass" , { readOnly : true } )
The document structure for these two syntaxes is different. Please see the attached "Issue8848" screenshot. "user1" is created using syntax 1 and "user2" using syntax 2.
The SHOW USERS command returns READ permission for "user1" but "READWRITE" permission for "user2".
The second db.addUser() MongoShell command is invalid.
The MongoDB documentation is misleading. See my notes on issue #8628 .
The second db.addUser() MongoShell command is invalid.
The MongoDB documentation is misleading. See my notes on issue #8628 .
Issue #8848 |
Closed |
Invalid |
Resolved |
Completion |
No due date |
No fixed build |
No time estimate |
1 issue link |
relates to #8628
Issue #8628NPE on expanding the mongodb Users node |
Please run the "db.system.users.find()" command in the mongo shell and let me know the results.
It looks like you are using MongoDB version 2.4 with the addUser() syntax for version 2.2.