Details
-
Task
-
Resolution: Done
-
Major - P3
-
None
-
None
Description
The example for db.createRole() (http://docs.mongodb.org/manual/reference/method/db.createRole/#example), the write concern should be passed as a document in a separate argument not as part of the role document.
use admin
|
db.createRole({ role: "myClusterwideAdmin", |
privileges: [
|
{ resource: { cluster: true }, actions: [ "addShard" ] }, |
{ resource: { db: "config", collection: "" }, actions: [ "find", "update", "insert", "remove" ] }, |
{ resource: { db: "users", collection: "usersCollection" }, actions: [ "update", "insert", "remove" ] }, |
{ resource: { db: "", collection: "" }, actions: [ "find" ] } |
],
|
roles: [
|
{ role: "read", db: "admin" } |
],
|
writeConcern: { w: "majority" , wtimeout: 5000 } |
})
|
I believe should be...
use admin
|
db.createRole({ role: "myClusterwideAdmin", |
privileges: [
|
{ resource: { cluster: true }, actions: [ "addShard" ] }, |
{ resource: { db: "config", collection: "" }, actions: [ "find", "update", "insert", "remove" ] }, |
{ resource: { db: "users", collection: "usersCollection" }, actions: [ "update", "insert", "remove" ] }, |
{ resource: { db: "", collection: "" }, actions: [ "find" ] } |
],
|
roles: [
|
{ role: "read", db: "admin" } |
]},
|
{ w: "majority" , wtimeout: 5000 } |
)
|