I am getting the above error in Mongo DB when entering the following in the shell but I can't for the life of me see where there is a syntax error...
db.createUser (
... "user":"dbTest",
... "pwd":"testPass",
... "roles": [
... { "role":"readWrite", "db":"test" }
... ]
... )
That has been copied and pasted directly from the console.
You're missing curly braces around the object literal:
db.createUser ({
"user":"dbTest",
"pwd":"testPass",
"roles": [
{ "role":"readWrite", "db":"test" }
]
})
See db.createUser()
- Examples
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With