I've got some rights issues with mongoDB, I created a DB admin using the auth menthod, and this worked.
I can connect from a distant server to my DB without any warning, using the admin account I created with the role "userAdminAnyDatabase". But, when I use a different DB (use myDB) I cannot run db.runCommand.
Here is what I get:
> db.runCommand({createIndexes: "C_Cache", indexes: [{key: {tags: 1}, name: "tags_1"}]})
{
"ok" : 0,
"errmsg" : "not authorized on myDB to execute command { createIndexes: \"C_Cache\", indexes: [ { key: { tags: 1.0 }, name: \"tags_1\" } ] }",
"code" : 13
}
When I comment "auth" in the configuration file, all work perfectly. But this is not what I want. I need that authentication method.
EDIT:
I just misunderstood the meaning of "userAdminAnyDatabase", this does not give you the rights to modify other DB. For this it seems to need the role "root" to fit super-user roles