I am new to mongodb and just started with mongodb .I am writingto grant roles to user but throw SyntaxError: missing : after property id @(shell):1:36.Tried removing space but did not workout .
db.grantRolesToUser(
{
"user",
roles: [{
"role" : "readWrite",
"db" : "chatlogging"
},
{ role: "userAdminAnyDatabase", db: "admin"}]
}
)
Any clue on this .Thanks in advance.