Returns information for all the roles in the database on which the command runs. The method can be run with or without an argument.
To return more information, pass the
db.getRoles()a document with the following fields:
Field Type Description
integer Set this field to
1to retrieve all user-defined roles.
boolean Optional. Set the field to
trueto show role privileges, including both privileges inherited from other roles and privileges defined directly. By default, the command returns only the roles from which this role inherits privileges and does not return specific privileges.
boolean Optional. Set to true to display built-in roles as well as user-defined roles.