getUsers()
This method returns information for all the users in the database.
Syntax:
db.getUsers()
Example
MongoDB
db.getUsers()
Output:
[{"_id" : "admin.dbUser","userId" : UUID("a43d6942-5385-49fc-a452-8183dbefa2f3"),"user" : "dbUser","db" : "admin","roles" : [{"role" : "read","db" : "stock"},{"role" : "readWrite","db" : "admin"},{"role" : "dbAdmin","db" : "admin"}],"mechanisms" : ["SCRAM-SHA-1","SCRAM-SHA-256"]}]
No comments:
Post a Comment