How to show all list users mongodb?

502    Asked by BuffyHeaton in SQL Server , Asked on Mar 14, 2023

I know show users or db.getUsers() can show all users in the current database in mongodb, but how to list all users in all databases for ease of management as an administrator?

Try this to show all list users mongodb:

use admin
db.system.users.find({}, { db: 1, user: 1})


Your Answer

Interviews

Parent Categories