Reputation: 1480
getting "pymongo.errors.OperationFailure: not authorized on admin to execute command" on Atlas mongo db instance.
And while I run the same command on a local mongo DB instance, I don't get the error.
db.command("usersInfo")
Upvotes: 0
Views: 191
Reputation: 13765
This is expected in Atlas shared tier (M0/M2/M5). See:
Regarding usersInfo
:
This command can only be called with arguments:
{user: <MYUSER>, db: 'admin'}
Local MongoDB instances wouldn't have this restriction because it's entirely your responsibility to secure the deployment, and thus not subject to strict secure default settings like Atlas.
Upvotes: 1