Good afternoon,
I am attempting to create a new user on the admin database. I have opened the MongoDb shell and am attempting to run the below command and get a syntax error. I have copied the command exactly from the online documentation and selected the admin database in my MongoDb shell but get the error below. Can someone help me please understand why I am getting this error and how to fix it?
db.createUser( {
user: “testUser”,
pwd: passwordPrompt(), // Or “”
customData: { “some info” },
roles: [
{ role: “”, db: “” } | “”,
…
],
authenticationRestrictions: [
{
clientSource: [“” | “”, …],
serverAddress: [“” | “”, …]
},
…
],
mechanisms: [ “<SCRAM-SHA-1|SCRAM-SHA-256>”, … ],
passwordDigestor: “<server|client>”
})
SyntaxError: Unexpected token (4:28)
2 | user: “testUser”,
3 | pwd: passwordPrompt(), // Or “”
4 | customData: { “some info” },
| ^
5 | roles: [
6 | { role: “”, db: “” } | “”,
7 | …