-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Environment:centos 7 and mongodb version is 2.4.9
I add a user with role
["readWrite","dbAdmin","clusterAdmin", "readWriteAnyDatabase", "dbAdminAnyDatabase"]
but when i log in mongodb, and execute `db.repairDatabase()`, i get the error:
{ "ok" : 0, "errmsg" : "unauthorized"}
.
In the beginning, I just added role `readWrite` and `dbAdmin`, and added more and more roles, but encountered that error.
I read https://docs.mongodb.org/manual/reference/built-in-roles/#built-in-roles, and it seems we can use `repairDatabase` when we have the dbAdmin role. But this doesn't seem to work. Can someone help me out of this problem? If you want more information, please tell me.
my test script is in the attachment.