admin.system.users.roles[n]. db 

The name of the database where role is defined. 

When specifying a role using the role management or user management commands, you can specify the role name alone (e.g. "readWrite" ) if the role that exists on the database on which the command is run. 

admin.system.users. customData 

The customData (page 417) field contains optional custom information about the user. 

## Example 

Changed in version 3.0.0. 

Consider the following document in the system.users collection: 

{ _id : "home.Kari", user : "Kari", db : "home", credentials : { "SCRAM-SHA-1" : { "iterationCount" : 10000, "salt" : nkHYXEZTTYmn+hrY994y1Q==", "storedKey" : "wxWGN3ElQ25WbPjACeXdUmN4nNo=", "serverKey" : "h7vBq5tACT/BtrIElY2QTm+pQzM=" } }, roles : [ { role: "read", db: "home" }, { role: "readWrite", db: "test" }, { role: "appUser", db: "myApp" } ], customData : { zipCode: "64157" } } 

The document shows that a user Kari is associated with the home database. Kari has the read (page 405) role in the home database, the readWrite (page 406) role in the test database, and the appUser role in the myApp database. 

## Resource Document 

The resource document specifies the resources upon which a privilege permits actions . 

## Database and/or Collection Resource 

To specify databases and/or collections, use the following syntax: 

{ db: <database>, collection: <collection> } 

Specify a Collection of a Database as Resource If the resource document species both the db and collection fields as non-empty strings, the resource is the specified collection in the specified database. For example, the following document specifies a resource of the inventory collection in the products database: 

{ db: "products", collection: "inventory" } 

