> show collections
2016-05-30T20:03:09.108+0000 E QUERY [thread1] Error: listCollections failed: {
"ok" : 0,
"errmsg" : "not authorized on healthCatalog to execute command { listCollections: 1.0, filter: {} }",
"code" : 13
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DB.prototype._getCollectionInfosCommand@src/mongo/shell/db.js:773:1
DB.prototype.getCollectionInfos@src/mongo/shell/db.js:785:19
DB.prototype.getCollectionNames@src/mongo/shell/db.js:796:16
shellHelper.show@src/mongo/shell/utils.js:753:9
shellHelper@src/mongo/shell/utils.js:650:15
@(shellhelp2):1:1Hi
I was told by my manager our MongoDB replicaSet requires authentication so this weekend I deployed a new 3.2 single instance deployment and created my role w/ the “userAdminAnyDatabase” role. I then restarted my mongod service w/ the —auth parameter and now I’m getting:
show collections
2016-05-30T20:03:09.108+0000 E QUERY [thread1] Error: listCollections failed: {
…
To be able to list collections, you need the listCollections privilege enabled. This privilege is provided by the dbAdmin role (also by the dbAdminAnyDatabase role, or the superuser root role).
The ‘userAdminAnyDatabase’ role allows the account to create and modify roles and users on any database. However it does not include the listCollections privilege.
Please see the Built-In Roles page for more detail regarding user roles and privileges.
Best regards,
Kevin