MongoDB Documentation, Release 3.0.4 Procedures The following procedures use the rolesInfo command. You also can use the methods db.getRole() (singular) and db.getRoles() . View a Role in the Current Database If the role is in the current database, you can refer to the role by name, as for the role dataEntry on the current database: db.runCommand({ rolesInfo: "dataEntry" }) View a Role in a Different Database If the role is in a different database, specify the role as a document. Use the following form: { role: "<role name>", db: "<role db>" } To view the custom appWriter role in the orders database, issue the following command from the mongo shell: db.runCommand({ rolesInfo: { role: "appWriter", db: "orders" } }) View Multiple Roles To view information for multiple roles, specify each role as a document or string in an array. To view the custom appWriter and clientWriter roles in the orders database, as well as the dataEntry role on the current database, use the following command from the mongo shell: View All Custom Roles To view the all custom roles, query admin.system.roles (page 413) collection directly, for example: Strong passwords help prevent unauthorized access, and all users should have strong passwords. You can use the openssl program to generate unique strings for use in passwords, as in the following command: openssl rand -base64 48 Changed in version 2.6. db = db.getSiblingDB('admin') db.system.roles.find() You must have the changeAnyPassword action (page 419) on a database to modify the password of any user on that database. Change a User’s Password Overview Prerequisites db.runCommand( { rolesInfo: [ { role: "appWriter", db: "orders" }, { role: "clientWriter", db: "orders" }, "dataEntry" ] } ) 395 6.3. Security Tutorials