Sunday, 28 May 2017

dbAdmin user can not execute list command on MongoDB 3

I created a new Database called meanapp.and I add a user meanUser for readWrite role.

When I connect to the mongo DB it connects but I got Error as

{ MongoError: not authorized on meanapp to execute command { listIndexes:"jobs", cursor:{}}

So , I tried to grant dbAdmin role to meanUser by executing

db.grantRolesToUser('meanUser',[{role:"dbAdmin", db: "meanapp" }] )

And tried restarting mongo deamon.

Still same error.

Could any one faced this issue or I am missing something?

I refered mongo docs also I could get an idea of this issue.

Thanks for your effort.



via RatheeshBabu

No comments:

Post a Comment