On this page
Privilege Actions
New in version 2.6.
On this page
Privilege actions define the operations a user can perform on a resource. A MongoDB privilege comprises a resource and the permitted actions. This page lists available actions grouped by common purpose.
MongoDB provides built-in roles with pre-defined pairings of resources and permitted actions. For lists of the actions granted, see Built-In Roles. To define custom roles, see Create a User-Defined Role.
Query and Write Actions
find-
User can perform the following commands, and their equivalent helper methods:
aggregatefor all pipeline operations except$collStats,$out, and$indexStats.checkShardingIndexcountdataSizedistinctfilemd5findgeoNeargeoSearchgetLastErrorgetMoregetPrevErrorgroupkillCursors, provided that the cursor is associated with a currently authenticated user.listCollectionslistIndexesmapReducewith the{out: inline}option.parallelCollectionScanresetError
Required for the query portion of the
mapReducecommand anddb.collection.mapReducehelper method when outputting to a collection.Required for the query portion of the
findAndModifycommand anddb.collection.findAndModifyhelper method.Required on the source collection for the
cloneCollectionAsCappedandrenameCollectioncommands and thedb.collection.renameCollection()helper method.Apply this action to database or collection resources.
insert-
User can perform the following commands and their equivalent methods:
Required for the output portion of the
mapReducecommand anddb.collection.mapReduce()helper method when outputting to a collection.Required for the
aggregatecommand anddb.collection.aggregate()helper method when using the$outpipeline operator.Required for the
updateandfindAndModifycommands and equivalent helper methods when used with theupsertoption.Required on the destination collection for the following commands and their helper methods:
Apply this action to database or collection resources.
remove-
User can perform the
deletecommand and equivalent helper method.Required for the write portion of the
findAndModifycommand anddb.collection.findAndModify()method.Required for the
mapReducecommand anddb.collection.mapReduce()helper method when you specify thereplaceaction when outputting to a collection.Required for the
aggregatecommand anddb.collection.aggregate()helper method when using the$outpipeline operator.Apply this action to database or collection resources.
update-
User can perform the
updatecommand and equivalent helper methods.Required for the
mapReducecommand anddb.collection.mapReduce()helper method when outputting to a collection without specifying thereplaceaction.Required for the
findAndModifycommand anddb.collection.findAndModify()helper method.Apply this action to database or collection resources.
bypassDocumentValidation-
New in version 3.2.
Users can bypass document validation on commands and methods that support the
bypassDocumentValidationoption:Command Method aggregatedb.collection.aggregate()applyOpscloneCollectionon the destination collectioncloneon the destinationcopydbon the destinationfindAndModifydb.collection.findAndModify()insertmapReducedb.collection.mapReduce()updateApply this action to database or collection resources.
useUUID-
New in version 3.6.
User can execute the following commands using a UUID as if it were a namespace:
For example, this privilege authorizes a user to run the following command which executes a
findcommand on a collection with the given UUID. In order to be successful, this operation also requires that the user is authorized to execute thefindcommand on the collection namespace corresponding to the given UUID.db.runCommand({find: UUID("123e4567-e89b-12d3-a456-426655440000")})For more information on collection UUIDs, see Collections.
Apply this action to the
clusterresource.
Database Management Actions
changeCustomData-
User can change the custom information of any user in the given database. Apply this action to database resources.
changeOwnCustomData-
Users can change their own custom information. Apply this action to database resources. See also Change Your Password and Custom Data.
changeOwnPassword-
Users can change their own passwords. Apply this action to database resources. See also Change Your Password and Custom Data.
changePassword-
User can change the password of any user in the given database. Apply this action to database resources.
createCollection-
User can perform the
db.createCollection()method. Apply this action to database or collection resources.
createIndex-
Provides access to the
db.collection.createIndex()method and thecreateIndexescommand. Apply this action to database or collection resources.
createRole-
User can create new roles in the given database. Apply this action to database resources.
createUser-
User can create new users in the given database. Apply this action to database resources.
dropCollection-
User can perform the
db.collection.drop()method. Apply this action to database or collection resources.
enableProfiler-
User can perform the
db.setProfilingLevel()method. Apply this action to database resources.
grantRole-
User can grant any role in the database to any user from any database in the system. Apply this action to database resources.
killCursors