db.serverCmdLineOpts()

Dear Team,

I am a new member and I just start to play around with mongoDB.
I have one question about permission in mongoDB.
After I enable security:authorization: “enabled”, I cannot use db.serverCmdLineOpts() to check dbpath.
The question is what role should I grant to my user to be able to use command db.serverCmdLineOpts() ?

Thanks,
Nara

Hi @Nara_Apple welcome to the community!

For the serverCmdLineOpts command, you’ll need the clusterAdmin or clusterMonitor role for the user.

You can search the linked page above for the commands you’re interested in. The page should list all commands available in MongoDB, along with the associated privilege required to run it.

Best regards
Kevin

2 Likes

Hello Sir,

It works now, thank you so much for your help.

Best regards,
Nara

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.