How to list all users in the mongo shell?
In the MongoDB shell, how do I list all users for the current database that I'm using?
I can't seem to find it anywhere. Don’t know how MongoDB list users?
To list all users in the mongo shell you can use the getUsers() method or show command.
Case 1 − Using getUsers() The syntax is as follows − db.getUsers();
db.getUsers()
Case 2 − Using show command. The syntax is as follows − ...
show users
Both commands print a list of users for the current database. See MongoDB documentation for User Management.