> This page location: /docs.md > /docs/development.md > /docs/manual/reference/database-users.md

> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

# Privilege Actions

Privilege actions define the operations a user can perform on a [resource](https://www.mongodb.com/docs/manual/reference/resource-document.md#std-label-resource-document). A MongoDB [privilege](https://www.mongodb.com/docs/manual/core/authorization.md#std-label-privileges) comprises a [resource](https://www.mongodb.com/docs/manual/reference/resource-document.md#std-label-resource-document) 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](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#std-label-built-in-roles)

- [Built-In Roles on Atlas](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#std-label-mongodb-users-roles-and-privileges)

To define custom roles, see:

- [Create a User-Defined Role in Self-Managed Deployments](https://www.mongodb.com/docs/manual/tutorial/manage-users-and-roles.md#std-label-create-user-defined-role)

- [Create User-Defined Roles in Atlas](https://www.mongodb.com/docs/atlas/security-add-mongodb-roles.md#std-label-add-mongodb-roles)

## Query and Write Actions

User can perform the following commands and their equivalent helper methods:

- [`aggregate`](https://www.mongodb.com/docs/manual/reference/command/aggregate.md#mongodb-dbcommand-dbcmd.aggregate) for all [pipeline operations](https://www.mongodb.com/docs/manual/reference/mql/aggregation-stages.md#std-label-aggregation-pipeline-operator-reference) **except** [`$collStats`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/collstats.md#mongodb-pipeline-pipe.-collStats), [`$out`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/out.md#mongodb-pipeline-pipe.-out), and [`$indexStats`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexstats.md#mongodb-pipeline-pipe.-indexStats)

- [`count`](https://www.mongodb.com/docs/manual/reference/command/count.md#mongodb-dbcommand-dbcmd.count)

- [`dataSize`](https://www.mongodb.com/docs/manual/reference/command/datasize.md#mongodb-dbcommand-dbcmd.dataSize)

- [`distinct`](https://www.mongodb.com/docs/manual/reference/command/distinct.md#mongodb-dbcommand-dbcmd.distinct)

- [`filemd5`](https://www.mongodb.com/docs/manual/reference/command/filemd5.md#mongodb-dbcommand-dbcmd.filemd5)

- [`find`](https://www.mongodb.com/docs/manual/reference/command/find.md#mongodb-dbcommand-dbcmd.find)

- [`getMore`](https://www.mongodb.com/docs/manual/reference/command/getmore.md#mongodb-dbcommand-dbcmd.getMore)

- [`killCursors`](https://www.mongodb.com/docs/manual/reference/command/killcursors.md#mongodb-dbcommand-dbcmd.killCursors), provided that the cursor is associated with a currently authenticated user

- [`listCollections`](https://www.mongodb.com/docs/manual/reference/command/listcollections.md#mongodb-dbcommand-dbcmd.listCollections)

- [`listIndexes`](https://www.mongodb.com/docs/manual/reference/command/listindexes.md#mongodb-dbcommand-dbcmd.listIndexes)

- [`mapReduce`](https://www.mongodb.com/docs/manual/reference/command/mapreduce.md#mongodb-dbcommand-dbcmd.mapReduce) with the `{out: inline}` option

Required for the query portion of the [`mapReduce`](https://www.mongodb.com/docs/manual/reference/command/mapreduce.md#mongodb-dbcommand-dbcmd.mapReduce) command and [`db.collection.mapReduce()`](https://www.mongodb.com/docs/manual/reference/method/db.collection.mapreduce.md#mongodb-method-db.collection.mapReduce) helper method when [outputting to a collection.](https://www.mongodb.com/docs/manual/reference/method/db.collection.mapreduce.md#std-label-mapreduce-out-mtd)

Required for the query portion of the [`findAndModify`](https://www.mongodb.com/docs/manual/reference/command/findandmodify.md#mongodb-dbcommand-dbcmd.findAndModify) command and [`db.collection.findAndModify()`](https://www.mongodb.com/docs/manual/reference/method/db.collection.findandmodify.md#mongodb-method-db.collection.findAndModify) helper method.

Required on the *source* collection for the [`cloneCollectionAsCapped`](https://www.mongodb.com/docs/manual/reference/command/clonecollectionascapped.md#mongodb-dbcommand-dbcmd.cloneCollectionAsCapped) and [`renameCollection`](https://www.mongodb.com/docs/manual/reference/command/renamecollection.md#mongodb-dbcommand-dbcmd.renameCollection) commands and the [`db.collection.renameCollection()`](https://www.mongodb.com/docs/manual/reference/method/db.collection.renamecollection.md#mongodb-method-db.collection.renameCollection) helper method.

Users without the [`listDatabases`](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-listDatabases) privilege action can run the [`listDatabases`](https://www.mongodb.com/docs/manual/reference/command/listdatabases.md#mongodb-dbcommand-dbcmd.listDatabases) command to return a list of databases for which they have privileges. This includes databases where the user has privileges on specific collections. Run the command with the `authorizedDatabases` option unspecified or set to `true`.

Apply this action to database or collection resources.

User can perform the following commands and their equivalent methods:

- [`insert`](https://www.mongodb.com/docs/manual/reference/command/insert.md#mongodb-dbcommand-dbcmd.insert)

- [`create`](https://www.mongodb.com/docs/manual/reference/command/create.md#mongodb-dbcommand-dbcmd.create)

Required for the output portion of the [`mapReduce`](https://www.mongodb.com/docs/manual/reference/command/mapreduce.md#mongodb-dbcommand-dbcmd.mapReduce) command and [`db.collection.mapReduce()`](https://www.mongodb.com/docs/manual/reference/method/db.collection.mapreduce.md#mongodb-method-db.collection.mapReduce) helper method when [outputting to a collection.](https://www.mongodb.com/docs/manual/reference/method/db.collection.mapreduce.md#std-label-mapreduce-out-mtd)

Required for the [`aggregate`](https://www.mongodb.com/docs/manual/reference/command/aggregate.md#mongodb-dbcommand-dbcmd.aggregate) command and [`db.collection.aggregate()`](https://www.mongodb.com/docs/manual/reference/method/db.collection.aggregate.md#mongodb-method-db.collection.aggregate) helper method when using the [`$out`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/out.md#mongodb-pipeline-pipe.-out) or [`$merge`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/merge.md#mongodb-pipeline-pipe.-merge) pipeline operator.

Required for the [`update`](https://www.mongodb.com/docs/manual/reference/command/update.md#mongodb-dbcommand-dbcmd.update) and [`findAndModify`](https://www.mongodb.com/docs/manual/reference/command/findandmodify.md#mongodb-dbcommand-dbcmd.findAndModify) commands and equivalent helper methods when used with the `upsert` option.

Required on the *destination* collection for the following commands and their helper methods:

- [`cloneCollectionAsCapped`](https://www.mongodb.com/docs/manual/reference/command/clonecollectionascapped.md#mongodb-dbcommand-dbcmd.cloneCollectionAsCapped)

- [`renameCollection`](https://www.mongodb.com/docs/manual/reference/command/renamecollection.md#mongodb-dbcommand-dbcmd.renameCollection)

Apply this action to database or collection resources.

User can perform the [`delete`](https://www.mongodb.com/docs/manual/reference/command/delete.md#mongodb-dbcommand-dbcmd.delete) command and equivalent helper method.

Required for the write portion of the [`findAndModify`](https://www.mongodb.com/docs/manual/reference/command/findandmodify.md#mongodb-dbcommand-dbcmd.findAndModify) command and [`db.collection.findAndModify()`](https://www.mongodb.com/docs/manual/reference/method/db.collection.findandmodify.md#mongodb-method-db.collection.findAndModify) method.

Required for the [`mapReduce`](https://www.mongodb.com/docs/manual/reference/command/mapreduce.md#mongodb-dbcommand-dbcmd.mapReduce) command and [`db.collection.mapReduce()`](https://www.mongodb.com/docs/manual/reference/method/db.collection.mapreduce.md#mongodb-method-db.collection.mapReduce) helper method when specifying the `replace` action when [outputting to a collection.](https://www.mongodb.com/docs/manual/reference/method/db.collection.mapreduce.md#std-label-mapreduce-out-mtd)

Required for the [`aggregate`](https://www.mongodb.com/docs/manual/reference/command/aggregate.md#mongodb-dbcommand-dbcmd.aggregate) command and [`db.collection.aggregate()`](https://www.mongodb.com/docs/manual/reference/method/db.collection.aggregate.md#mongodb-method-db.collection.aggregate) helper method when using the [`$out`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/out.md#mongodb-pipeline-pipe.-out) pipeline operator.

Apply this action to database or collection resources.

User can perform the [`update`](https://www.mongodb.com/docs/manual/reference/command/update.md#mongodb-dbcommand-dbcmd.update) command and equivalent helper methods.

Required for the [`mapReduce`](https://www.mongodb.com/docs/manual/reference/command/mapreduce.md#mongodb-dbcommand-dbcmd.mapReduce) command and [`db.collection.mapReduce()`](https://www.mongodb.com/docs/manual/reference/method/db.collection.mapreduce.md#mongodb-method-db.collection.mapReduce) helper method when [outputting to a collection](https://www.mongodb.com/docs/manual/reference/method/db.collection.mapreduce.md#std-label-mapreduce-out-mtd) without specifying the `replace` action.

Required for the [`findAndModify`](https://www.mongodb.com/docs/manual/reference/command/findandmodify.md#mongodb-dbcommand-dbcmd.findAndModify) command and [`db.collection.findAndModify()`](https://www.mongodb.com/docs/manual/reference/method/db.collection.findandmodify.md#mongodb-method-db.collection.findAndModify) helper method.

Apply this action to database or collection resources.

Users can bypass [schema validation](https://www.mongodb.com/docs/manual/core/schema-validation.md#std-label-schema-validation-overview) on commands and methods that support the `bypassDocumentValidation` option. The following commands and their equivalent methods support bypassing schema validation:

- [`aggregate`](https://www.mongodb.com/docs/manual/reference/command/aggregate.md#mongodb-dbcommand-dbcmd.aggregate)

- [`applyOps`](https://www.mongodb.com/docs/manual/reference/command/applyops.md#mongodb-dbcommand-dbcmd.applyOps)

- [`findAndModify`](https://www.mongodb.com/docs/manual/reference/command/findandmodify.md#mongodb-dbcommand-dbcmd.findAndModify)

- [`insert`](https://www.mongodb.com/docs/manual/reference/command/insert.md#mongodb-dbcommand-dbcmd.insert)

- [`mapReduce`](https://www.mongodb.com/docs/manual/reference/command/mapreduce.md#mongodb-dbcommand-dbcmd.mapReduce)

- [`update`](https://www.mongodb.com/docs/manual/reference/command/update.md#mongodb-dbcommand-dbcmd.update)

Apply this action to database or collection resources.

User can execute the following commands using a UUID (Universally Unique Identifier) as if it were a namespace:

- [`find`](https://www.mongodb.com/docs/manual/reference/command/find.md#mongodb-dbcommand-dbcmd.find)

- [`listIndexes`](https://www.mongodb.com/docs/manual/reference/command/listindexes.md#mongodb-dbcommand-dbcmd.listIndexes)

This privilege authorizes a user to run the following command, which executes a [`find`](https://www.mongodb.com/docs/manual/reference/command/find.md#mongodb-dbcommand-dbcmd.find) command on a collection with the given UUID. For this operation to succeed, the user must be authorized to execute the `find` command on the collection namespace corresponding to the given UUID.

```javascript
db.runCommand({find: UUID("123e4567-e89b-12d3-a456-426655440000")})
```

For more information on collection UUIDs, see [Collections.](https://www.mongodb.com/docs/manual/core/databases-and-collections.md#std-label-collections)

Apply this action to the `cluster` resource.

## Database Management Actions

User can change the custom information of any user in the given database. Apply this action to database resources.

Users can change their own custom information. Apply this action to database resources. See also [Change Your Password and Custom Data.](https://www.mongodb.com/docs/manual/tutorial/change-own-password-and-custom-data.md#std-label-change-password-custom-data)

Users can change their own passwords. Apply this action to database resources. See also [Change Your Password and Custom Data.](https://www.mongodb.com/docs/manual/tutorial/change-own-password-and-custom-data.md#std-label-change-password-custom-data)

User can change the password of any user in the given database. Apply this action to database resources.

User can perform the [`db.createCollection()`](https://www.mongodb.com/docs/manual/reference/method/db.createcollection.md#mongodb-method-db.createCollection) method. Apply this action to database or collection resources.

Provides access to the [`db.collection.createIndex()`](https://www.mongodb.com/docs/manual/reference/method/db.collection.createindex.md#mongodb-method-db.collection.createIndex) method and the [`createIndexes`](https://www.mongodb.com/docs/manual/reference/command/createindexes.md#mongodb-dbcommand-dbcmd.createIndexes) command. Apply this action to database or collection resources.

User can create new roles in the given database. Apply this action to database resources.

User can create new users in the given database. Apply this action to database resources.

User can perform the [`db.collection.drop()`](https://www.mongodb.com/docs/manual/reference/method/db.collection.drop.md#mongodb-method-db.collection.drop) method. Apply this action to database or collection resources.

User can delete any role from the given database. Apply this action to database resources.

User can remove any user from the given database. Apply this action to database resources.

User can perform the [`db.setProfilingLevel()`](https://www.mongodb.com/docs/manual/reference/method/db.setprofilinglevel.md#mongodb-method-db.setProfilingLevel) method. Apply this action to database resources.

User can grant any role in the database to any user from any database in the system. Apply this action to database resources.

Users can always terminate their own cursors, regardless of whether the users have the privilege to `killCursors`.

User can kill **any** cursor, even cursors created by other users. Apply this action to collection resources.

User can run the [`planCacheClearFilters`](https://www.mongodb.com/docs/manual/reference/command/plancacheclearfilters.md#mongodb-dbcommand-dbcmd.planCacheClearFilters), [`planCacheListFilters`](https://www.mongodb.com/docs/manual/reference/command/plancachelistfilters.md#mongodb-dbcommand-dbcmd.planCacheListFilters), and [`planCacheSetFilter`](https://www.mongodb.com/docs/manual/reference/command/plancachesetfilter.md#mongodb-dbcommand-dbcmd.planCacheSetFilter) commands. Apply the [`planCacheIndexFilter`](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-planCacheIndexFilter) action to collection resources.

User can run the [`setQuerySettings`](https://www.mongodb.com/docs/manual/reference/command/setquerysettings.md#mongodb-dbcommand-dbcmd.setQuerySettings) and [`removeQuerySettings`](https://www.mongodb.com/docs/manual/reference/command/removequerysettings.md#mongodb-dbcommand-dbcmd.removeQuerySettings) commands, and add a [`$querySettings`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/querysettings.md#mongodb-pipeline-pipe.-querySettings) stage to an aggregation pipeline.

**New in version 8.0**

User can remove any role from any user from any database in the system. Apply this action to database resources.

User can specify the [authenticationRestrictions](https://www.mongodb.com/docs/manual/reference/command/createuser.md#std-label-create-user-auth-restrictions) field in the `user` document when running the following commands:

- [`createUser`](https://www.mongodb.com/docs/manual/reference/command/createuser.md#mongodb-dbcommand-dbcmd.createUser)

- [`updateUser`](https://www.mongodb.com/docs/manual/reference/command/updateuser.md#mongodb-dbcommand-dbcmd.updateUser)

User can specify the `authenticationRestrictions` field in the `role` document when running the following commands:

- [`createRole`](https://www.mongodb.com/docs/manual/reference/command/createrole.md#mongodb-dbcommand-dbcmd.createRole)

- [`updateRole`](https://www.mongodb.com/docs/manual/reference/command/updaterole.md#mongodb-dbcommand-dbcmd.updateRole)

**Note:**

The following built-in roles grant this privilege:

- The [`userAdmin`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-userAdmin) role provides this privilege on the database that the role is assigned.

- The [`userAdminAnyDatabase`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-userAdminAnyDatabase) role provides this privilege on all databases.

Transitively, the [`restore`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-restore) and [`root`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-root) roles also provide this privilege.

Apply this action to database resources.

User can run the [`setFeatureCompatibilityVersion`](https://www.mongodb.com/docs/manual/reference/command/setfeaturecompatibilityversion.md#mongodb-dbcommand-dbcmd.setFeatureCompatibilityVersion) command. Apply this action to the `cluster` resource.

User can perform the [`db.fsyncUnlock()`](https://www.mongodb.com/docs/manual/reference/method/db.fsyncunlock.md#mongodb-method-db.fsyncUnlock) method. Apply this action to the `cluster` resource.

User can view information about any role in the given database. Apply this action to database resources.

User can view the information of any user in the given database. Apply this action to database resources.

## Deployment Management Actions

User can perform the `authSchemaUpgrade` command. Apply this action to the `cluster` resource.

User can perform the `cleanupOrphaned` command. Apply this action to the `cluster` resource.

User can enable and use the CPU profiler. Apply this action to the `cluster` resource.

User can use the [`db.currentOp()`](https://www.mongodb.com/docs/manual/reference/method/db.currentop.md#mongodb-method-db.currentOp) method to return information on pending and active operations. Apply this action to the `cluster` resource.

Even without the [`inprog`](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-inprog) privilege, on [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instances, users can view their own operations by running `db.currentOp( { "$ownOps": true } )`.

Provides access to the [`invalidateUserCache`](https://www.mongodb.com/docs/manual/reference/command/invalidateusercache.md#mongodb-dbcommand-dbcmd.invalidateUserCache) command. Apply this action to the `cluster` resource.

User can perform the [`db.killOp()`](https://www.mongodb.com/docs/manual/reference/method/db.killop.md#mongodb-method-db.killOp) method. Apply this action to the `cluster` resource.

Even without the [`killop`](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-killop) privilege, on [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instances, users can kill their own operations.

User can run the following operations:

- [`$planCacheStats`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/plancachestats.md#mongodb-pipeline-pipe.-planCacheStats) aggregation stage

Apply this action to database or collection resources.

User can perform the [`planCacheClear`](https://www.mongodb.com/docs/manual/reference/command/plancacheclear.md#mongodb-dbcommand-dbcmd.planCacheClear) command and the [`PlanCache.clear()`](https://www.mongodb.com/docs/manual/reference/method/plancache.clear.md#mongodb-method-PlanCache.clear) and [`PlanCache.clearPlansByQuery()`](https://www.mongodb.com/docs/manual/reference/method/plancache.clearplansbyquery.md#mongodb-method-PlanCache.clearPlansByQuery) methods. Apply this action to database or collection resources.

## Change Stream Actions

User with [`changeStream`](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-changeStream) and [`find`](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-find) on the specific collection, all non-`system` collections in a specific database, or all non-`system` collections across all databases can open [change stream cursor](https://www.mongodb.com/docs/manual/changestreams.md#std-label-changeStreams) for that resource.

## Replication Actions

User can append notes to the oplog. Apply this action to the `cluster` resource.

User can configure a replica set. Apply this action to the `cluster` resource.

User can view a replica set's configuration. Provides access to the [`replSetGetConfig`](https://www.mongodb.com/docs/manual/reference/command/replsetgetconfig.md#mongodb-dbcommand-dbcmd.replSetGetConfig) command and [`rs.conf()`](https://www.mongodb.com/docs/manual/reference/method/rs.conf.md#mongodb-method-rs.conf) helper method.

Apply this action to the `cluster` resource.

User can perform the [`replSetGetStatus`](https://www.mongodb.com/docs/manual/reference/command/replsetgetstatus.md#mongodb-dbcommand-dbcmd.replSetGetStatus) command. Apply this action to the `cluster` resource.

User can perform the deprecated `replSetHeartbeat` command. Apply this action to the `cluster` resource.

User can change the state of a replica set through the [`replSetFreeze`](https://www.mongodb.com/docs/manual/reference/command/replsetfreeze.md#mongodb-dbcommand-dbcmd.replSetFreeze), [`replSetMaintenance`](https://www.mongodb.com/docs/manual/reference/command/replsetmaintenance.md#mongodb-dbcommand-dbcmd.replSetMaintenance), [`replSetStepDown`](https://www.mongodb.com/docs/manual/reference/command/replsetstepdown.md#mongodb-dbcommand-dbcmd.replSetStepDown), and [`replSetSyncFrom`](https://www.mongodb.com/docs/manual/reference/command/replsetsyncfrom.md#mongodb-dbcommand-dbcmd.replSetSyncFrom) commands. Apply this action to the `cluster` resource.

User can perform the deprecated `resync` command. Apply this action to the `cluster` resource.

## Sharding Actions

User can perform the [`addShard`](https://www.mongodb.com/docs/manual/reference/command/addshard.md#mongodb-dbcommand-dbcmd.addShard) command. Apply this action to the `cluster` resource.

User can perform the [`analyzeShardKey`](https://www.mongodb.com/docs/manual/reference/command/analyzeshardkey.md#mongodb-dbcommand-dbcmd.analyzeShardKey) command. Apply this action to the database and collection resources.

Included in the [`clusterManager`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterManager) and [`enableSharding`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-enableSharding) built-in roles.

User can perform the [`checkMetadataConsistency`](https://www.mongodb.com/docs/manual/reference/command/checkmetadataconsistency.md#mongodb-dbcommand-dbcmd.checkMetadataConsistency) command. Apply this action to `cluster`, database or collection resources.

**New in version 7.0**

Required to clear a chunk's jumbo flag using the [`clearJumboFlag`](https://www.mongodb.com/docs/manual/reference/command/clearjumboflag.md#mongodb-dbcommand-dbcmd.clearJumboFlag) command. Apply this action to database or collection resources.

Included in the [`clusterManager`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterManager) built-in role.

**Note: Applicable Resources**

The action can apply to either:

- [Database](https://www.mongodb.com/docs/manual/reference/resource-document.md#std-label-resource-specific-db) or [collection](https://www.mongodb.com/docs/manual/reference/resource-document.md#std-label-resource-specific-db-collection) resource to enable sharding for a database or shard a collection.

- [Cluster](https://www.mongodb.com/docs/manual/reference/resource-document.md#std-label-resource-specific-collection) resource to perform various shard zone operations.

| Resources | Description |
| --- | --- |
| [Database](https://www.mongodb.com/docs/manual/reference/resource-document.md#std-label-resource-specific-db) or[Collection](https://www.mongodb.com/docs/manual/reference/resource-document.md#std-label-resource-specific-db-collection) | Grants users privileges to perform the following operations: Enable sharding on a database using the [`enableSharding`](https://www.mongodb.com/docs/manual/reference/command/enablesharding.md#mongodb-dbcommand-dbcmd.enableSharding) command; Shard a collection using the [`shardCollection`](https://www.mongodb.com/docs/manual/reference/command/shardcollection.md#mongodb-dbcommand-dbcmd.shardCollection) command |
| [Cluster](https://www.mongodb.com/docs/manual/reference/resource-document.md#std-label-resource-cluster) | Grants users privileges to perform the following shard zone operations: [`addShardToZone`](https://www.mongodb.com/docs/manual/reference/command/addshardtozone.md#mongodb-dbcommand-dbcmd.addShardToZone); [`updateZoneKeyRange`](https://www.mongodb.com/docs/manual/reference/command/updatezonekeyrange.md#mongodb-dbcommand-dbcmd.updateZoneKeyRange); [`removeShardFromZone`](https://www.mongodb.com/docs/manual/reference/command/removeshardfromzone.md#mongodb-dbcommand-dbcmd.removeShardFromZone) You can also perform these shard zone operations if you have [`find`/](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-find)[`update`](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-update) actions on the appropriate collections in the `config` database. Refer to the specific operations for details. |

Provides privileges to refine the shard key for a sharded collection and run the [`refineCollectionShardKey`](https://www.mongodb.com/docs/manual/reference/command/refinecollectionshardkey.md#mongodb-dbcommand-dbcmd.refineCollectionShardKey) command. Apply this action to [database](https://www.mongodb.com/docs/manual/reference/resource-document.md#std-label-resource-specific-db) or [collection](https://www.mongodb.com/docs/manual/reference/resource-document.md#std-label-resource-specific-db-collection) resources.

Included in the [`clusterManager`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterManager) built-in role.

User can perform the [`moveCollection`](https://www.mongodb.com/docs/manual/reference/command/movecollection.md#mongodb-dbcommand-dbcmd.moveCollection) command. Apply this action to the `cluster` resource.

**New in version 8.0**

User can perform the [`reshardCollection`](https://www.mongodb.com/docs/manual/reference/command/reshardcollection.md#mongodb-dbcommand-dbcmd.reshardCollection) command. Apply this action to [database](https://www.mongodb.com/docs/manual/reference/resource-document.md#std-label-resource-specific-db) or [collection](https://www.mongodb.com/docs/manual/reference/resource-document.md#std-label-resource-specific-db-collection) resources.

**New in version 5.0**

User can perform the [`rewriteCollection`](https://www.mongodb.com/docs/manual/reference/command/rewritecollection.md#mongodb-dbcommand-dbcmd.rewriteCollection) and the [`abortRewriteCollection`](https://www.mongodb.com/docs/manual/reference/command/abortrewritecollection.md#mongodb-dbcommand-dbcmd.abortRewriteCollection) commands. Apply this action to [database](https://www.mongodb.com/docs/manual/reference/resource-document.md#std-label-resource-specific-db) or [collection](https://www.mongodb.com/docs/manual/reference/resource-document.md#std-label-resource-specific-db-collection) resources.

**New in version 8.3**

User can perform the [`unshardCollection`](https://www.mongodb.com/docs/manual/reference/command/unshardcollection.md#mongodb-dbcommand-dbcmd.unshardCollection) command. Apply this action to the `cluster` resource.

**New in version 8.0**

User can perform the [`flushRouterConfig`](https://www.mongodb.com/docs/manual/reference/command/flushrouterconfig.md#mongodb-dbcommand-dbcmd.flushRouterConfig) command. Apply this action to the `cluster` resource.

User can perform the [`getClusterParameter`](https://www.mongodb.com/docs/manual/reference/command/getclusterparameter.md#mongodb-dbcommand-dbcmd.getClusterParameter) command. Apply this action to the `cluster` resource.

**New in version 6.0**

User can perform the [`getShardMap`](https://www.mongodb.com/docs/manual/reference/command/getshardmap.md#mongodb-dbcommand-dbcmd.getShardMap) command. Apply this action to the `cluster` resource.

User can perform the [`listShards`](https://www.mongodb.com/docs/manual/reference/command/listshards.md#mongodb-dbcommand-dbcmd.listShards) command. Apply this action to the `cluster` resource.

User can perform the [`moveChunk`](https://www.mongodb.com/docs/manual/reference/command/movechunk.md#mongodb-dbcommand-dbcmd.moveChunk) and [`moveRange`](https://www.mongodb.com/docs/manual/reference/command/moverange.md#mongodb-dbcommand-dbcmd.moveRange) commands. In addition, user can perform the [`movePrimary`](https://www.mongodb.com/docs/manual/reference/command/moveprimary.md#mongodb-dbcommand-dbcmd.movePrimary) command provided that the privilege is applied to an appropriate database resource. Apply this action to database or collection resources.

User can perform the [`removeShard`](https://www.mongodb.com/docs/manual/reference/command/removeshard.md#mongodb-dbcommand-dbcmd.removeShard) command. Apply this action to the `cluster` resource.

User can perform the [`$shardedDataDistribution`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/shardeddatadistribution.md#mongodb-pipeline-pipe.-shardedDataDistribution) aggregation pipeline stage.

**New in version 6.0.3**

User can perform the [`shardingState`](https://www.mongodb.com/docs/manual/reference/command/shardingstate.md#mongodb-dbcommand-dbcmd.shardingState) command. Apply this action to the `cluster` resource.

User can perform the [`split`](https://www.mongodb.com/docs/manual/reference/command/split.md#mongodb-dbcommand-dbcmd.split) command. Apply this action to the `cluster` resource.

User with this action on the `cluster` resource can run the [`transitionFromDedicatedConfigServer`](https://www.mongodb.com/docs/manual/reference/command/transitionfromdedicatedconfigserver.md#mongodb-dbcommand-dbcmd.transitionFromDedicatedConfigServer) command.

**New in version 8.0**

User with this action on the `cluster` resource can run the [`transitionToDedicatedConfigServer`](https://www.mongodb.com/docs/manual/reference/command/transitiontodedicatedconfigserver.md#mongodb-dbcommand-dbcmd.transitionToDedicatedConfigServer) command.

**New in version 8.0**

## Server Administration Actions

User can perform the [`logApplicationMessage`](https://www.mongodb.com/docs/manual/reference/command/logapplicationmessage.md#mongodb-dbcommand-dbcmd.logApplicationMessage) command. Apply this action to the `cluster` resource.

User can perform writes even when writes are blocked by the [`setUserWriteBlockMode`](https://www.mongodb.com/docs/manual/reference/command/setuserwriteblockmode.md#mongodb-dbcommand-dbcmd.setUserWriteBlockMode) command. Apply this action to the `cluster` resource.

All queries run by the user ignore the value of the [`defaultMaxTimeMS`](https://www.mongodb.com/docs/manual/reference/cluster-parameters/defaultmaxtimems.md#mongodb-parameter-param.defaultMaxTimeMS) parameter.

**New in version 8.0**

User can perform the deprecated `closeAllDatabases` command. Apply this action to the `cluster` resource.

User can perform the [`collMod`](https://www.mongodb.com/docs/manual/reference/command/collmod.md#mongodb-dbcommand-dbcmd.collMod) command. Apply this action to database or collection resources.

User can perform the [`compact`](https://www.mongodb.com/docs/manual/reference/command/compact.md#mongodb-dbcommand-dbcmd.compact) command. Apply this action to database or collection resources.

On self-managed deployments, you also need the `compact` privilege action on the cluster resource to run the [`autoCompact`](https://www.mongodb.com/docs/manual/reference/command/autocompact.md#mongodb-dbcommand-dbcmd.autoCompact) command. For required privileges per deployment type, see [Required Privileges.](https://www.mongodb.com/docs/manual/reference/command/autocompact.md#std-label-autocompact-authentication)

User can perform the [`compactStructuredEncryptionData`](https://www.mongodb.com/docs/manual/reference/command/compactstructuredencryptiondata.md#mongodb-dbcommand-dbcmd.compactStructuredEncryptionData) command. Apply this action to database resources.

**Note:**

**Changed in version 9.0**

(and 8.3.8, 8.2.13, 8.0.29, 7.0.40)

This action applies only to database resources. In earlier versions, you could also apply this action to collection resources.

User can perform the internal `connPoolSync` command. Apply this action to the `cluster` resource.

User can perform the [`convertToCapped`](https://www.mongodb.com/docs/manual/reference/command/converttocapped.md#mongodb-dbcommand-dbcmd.convertToCapped) command. Apply this action to database or collection resources.

User can perform the [`dropConnections`](https://www.mongodb.com/docs/manual/reference/command/dropconnections.md#mongodb-dbcommand-dbcmd.dropConnections) command. Apply this action to the `cluster` resource.

User can perform the [`dropDatabase`](https://www.mongodb.com/docs/manual/reference/command/dropdatabase.md#mongodb-dbcommand-dbcmd.dropDatabase) command. Apply this action to database resources.

User can perform the [`dropIndexes`](https://www.mongodb.com/docs/manual/reference/command/dropindexes.md#mongodb-dbcommand-dbcmd.dropIndexes) command. Apply this action to database or collection resources.

User can create a collection with a user-defined [collection UUID](https://www.mongodb.com/docs/manual/core/databases-and-collections.md#std-label-collections-uuids) using the [`applyOps`](https://www.mongodb.com/docs/manual/reference/command/applyops.md#mongodb-dbcommand-dbcmd.applyOps) command.

Apply this action to the `cluster` resource.

User can perform the [`fsync`](https://www.mongodb.com/docs/manual/reference/command/fsync.md#mongodb-dbcommand-dbcmd.fsync) command. Apply this action to the `cluster` resource.

User can issue the administrative [`getDefaultRWConcern`](https://www.mongodb.com/docs/manual/reference/command/getdefaultrwconcern.md#mongodb-dbcommand-dbcmd.getDefaultRWConcern) command. Apply this action to the `cluster` resource.

User can perform the [`getParameter`](https://www.mongodb.com/docs/manual/reference/command/getparameter.md#mongodb-dbcommand-dbcmd.getParameter) command. Apply this action to the `cluster` resource.

Provides information about the server the MongoDB instance runs on. Apply this action to the `cluster` resource.

Required to reset the 5 byte random string that is used in the [ObjectID.](https://www.mongodb.com/docs/manual/reference/bson-types.md#std-label-objectid)

User can perform the [`logRotate`](https://www.mongodb.com/docs/manual/reference/command/logrotate.md#mongodb-dbcommand-dbcmd.logRotate) command. Apply this action to the `cluster` resource.

User can perform the [`reIndex`](https://www.mongodb.com/docs/manual/reference/command/reindex.md#mongodb-dbcommand-dbcmd.reIndex) command. Apply this action to database or collection resources.

Allows the user to rename collections on the current database using the [`renameCollection`](https://www.mongodb.com/docs/manual/reference/command/renamecollection.md#mongodb-dbcommand-dbcmd.renameCollection) command. Apply this action to database resources.

Additionally, the user must either *have* [`find`](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-find) on the source collection or *not have* [`find`](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-find) on the destination collection.

If a collection with the new name already exists, the user must also have the [`dropCollection`](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-dropCollection) action on the destination collection.

User can perform the [`rotateCertificates`](https://www.mongodb.com/docs/manual/reference/command/rotatecertificates.md#mongodb-dbcommand-dbcmd.rotateCertificates) command command. Apply this action to the `cluster` resource.

User can issue the administrative [`setDefaultRWConcern`](https://www.mongodb.com/docs/manual/reference/command/setdefaultrwconcern.md#mongodb-dbcommand-dbcmd.setDefaultRWConcern) command. Apply this action to the `cluster` resource.

User can perform the [`setParameter`](https://www.mongodb.com/docs/manual/reference/command/setparameter.md#mongodb-dbcommand-dbcmd.setParameter) command. Apply this action to the `cluster` resource.

User can perform the [`setUserWriteBlockMode`](https://www.mongodb.com/docs/manual/reference/command/setuserwriteblockmode.md#mongodb-dbcommand-dbcmd.setUserWriteBlockMode) command. Apply this action to the `cluster` resource.

User can perform the [`shutdown`](https://www.mongodb.com/docs/manual/reference/command/shutdown.md#mongodb-dbcommand-dbcmd.shutdown) command. Apply this action to the `cluster` resource.

User can perform the deprecated `touch` command. Apply this action to the `cluster` resource.

## Session Actions

User can perform the [`killAllSessionsByPattern`](https://www.mongodb.com/docs/manual/reference/command/killallsessionsbypattern.md#mongodb-dbcommand-dbcmd.killAllSessionsByPattern) command with `users` and `roles` pattern. Apply this action to the `cluster` resource.

To run [`killAllSessionsByPattern`](https://www.mongodb.com/docs/manual/reference/command/killallsessionsbypattern.md#mongodb-dbcommand-dbcmd.killAllSessionsByPattern) command, users must also have [`killAnySession`](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-killAnySession) privileges on the cluster resource.

User can perform the [`$listSessions`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/listsessions.md#mongodb-pipeline-pipe.-listSessions) operation or [`$listLocalSessions`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/listlocalsessions.md#mongodb-pipeline-pipe.-listLocalSessions) operation for all users or specified user(s). Apply this action to the `cluster` resource.

User can perform the [`killAllSessions`](https://www.mongodb.com/docs/manual/reference/command/killallsessions.md#mongodb-dbcommand-dbcmd.killAllSessions) and the [`killAllSessionsByPattern`](https://www.mongodb.com/docs/manual/reference/command/killallsessionsbypattern.md#mongodb-dbcommand-dbcmd.killAllSessionsByPattern) command. Apply this action to the `cluster` resource.

**See also:**

[`impersonate`](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-impersonate)

## MongoDB Search Index Actions

The following actions enable users to run [MongoDB Search Database Commands](https://www.mongodb.com/docs/manual/reference/command.md#std-label-db-commands-atlas-search). These actions are only relevant for deployments hosted on [MongoDB Atlas.](https://www.mongodb.com/docs/atlas/)

User can run the [`createSearchIndexes`](https://www.mongodb.com/docs/manual/reference/command/createsearchindexes.md#mongodb-dbcommand-dbcmd.createSearchIndexes) database command. Apply this action to the database, collection, or view resource.

User can run the [`dropSearchIndex`](https://www.mongodb.com/docs/manual/reference/command/dropsearchindex.md#mongodb-dbcommand-dbcmd.dropSearchIndex) database command. Apply this action to the database, collection, or view resource.

User can run the [`$listSearchIndexes`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/listsearchindexes.md#mongodb-pipeline-pipe.-listSearchIndexes) aggregation stage. Apply this action to the database, collection, or view resource.

User can run the [`updateSearchIndex`](https://www.mongodb.com/docs/manual/reference/command/updatesearchindex.md#mongodb-dbcommand-dbcmd.updateSearchIndex) database command. Apply this action to the database, collection, or view resource.

## Diagnostic Actions

User can perform the [`collStats`](https://www.mongodb.com/docs/manual/reference/command/collstats.md#mongodb-dbcommand-dbcmd.collStats) command. Apply this action to database or collection resources.

User can perform the [`connPoolStats`](https://www.mongodb.com/docs/manual/reference/command/connpoolstats.md#mongodb-dbcommand-dbcmd.connPoolStats) command. Apply this action to the `cluster` resource.

User can perform the [`dbHash`](https://www.mongodb.com/docs/manual/reference/command/dbhash.md#mongodb-dbcommand-dbcmd.dbHash) command. Apply this action to database or collection resources.

User can perform the [`dbStats`](https://www.mongodb.com/docs/manual/reference/command/dbstats.md#mongodb-dbcommand-dbcmd.dbStats) command. Apply this action to database resources.

User can perform the [`getCmdLineOpts`](https://www.mongodb.com/docs/manual/reference/command/getcmdlineopts.md#mongodb-dbcommand-dbcmd.getCmdLineOpts) command. Apply this action to the `cluster` resource.

User can perform the [`getLog`](https://www.mongodb.com/docs/manual/reference/command/getlog.md#mongodb-dbcommand-dbcmd.getLog) command. Apply this action to the `cluster` resource.

User can run the [`$indexStats`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexstats.md#mongodb-pipeline-pipe.-indexStats) aggregation pipeline stage. Apply this action to database or collection resources.

To use the `$indexStats` stage, users must authenticate with at least the [`clusterMonitor`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterMonitor) role.

User can run the [`$listClusterCatalog`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/listclustercatalog.md#mongodb-pipeline-pipe.-listClusterCatalog) aggregation pipeline stage on the `admin` database. To run `$listClusterCatalog` on the `admin` database, users must authenticate with the [`clusterMonitor`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-clusterMonitor) role.

User can perform the [`listDatabases`](https://www.mongodb.com/docs/manual/reference/command/listdatabases.md#mongodb-dbcommand-dbcmd.listDatabases) command. Apply this action to the `cluster` resource.

Users without the [`listDatabases`](https://www.mongodb.com/docs/manual/reference/privilege-actions.md#mongodb-authaction-listDatabases) privilege action can run the [`listDatabases`](https://www.mongodb.com/docs/manual/reference/command/listdatabases.md#mongodb-dbcommand-dbcmd.listDatabases) command to return a list of databases for which they have privileges. This includes databases where the user has privileges on specific collections. Run the command with the `authorizedDatabases` option unspecified or set to `true`.

User can perform the [`listCollections`](https://www.mongodb.com/docs/manual/reference/command/listcollections.md#mongodb-dbcommand-dbcmd.listCollections) command. Apply this action to database resources.

**Note:**

Users without the required privilege can run the [`listCollections`](https://www.mongodb.com/docs/manual/reference/command/listcollections.md#mongodb-dbcommand-dbcmd.listCollections) command with **both** `authorizedCollections` and `nameOnly` options set to `true`. In this case, the command returns just the name and type of the collection(s) to which the user has privileges.

User can perform the [`listIndexes`](https://www.mongodb.com/docs/manual/reference/command/listindexes.md#mongodb-dbcommand-dbcmd.listIndexes) command. Apply this action to database or collection resources.

User can run the [`$queryStats`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/querystats.md#mongodb-pipeline-pipe.-queryStats) aggregation stage without the `transformIdentifiers` option.

User can run the [`$queryStats`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/querystats.md#mongodb-pipeline-pipe.-queryStats) aggregation stage with or without the `transformIdentifiers` option.

User can perform the [`serverStatus`](https://www.mongodb.com/docs/manual/reference/command/serverstatus.md#mongodb-dbcommand-dbcmd.serverStatus) command. Apply this action to the `cluster` resource.

User can perform the [`validate`](https://www.mongodb.com/docs/manual/reference/command/validate.md#mongodb-dbcommand-dbcmd.validate) and [`validateDBMetadata`](https://www.mongodb.com/docs/manual/reference/command/validatedbmetadata.md#mongodb-dbcommand-dbcmd.validateDBMetadata) commands. Apply this action to database or collection resources.

User can perform the [`top`](https://www.mongodb.com/docs/manual/reference/command/top.md#mongodb-dbcommand-dbcmd.top) command. Apply this action to the `cluster` resource.

## Internal Actions

Allows any action on a resource. **Do not** assign this action unless it is absolutely necessary.

Allows internal actions. **Do not** assign this action unless it is absolutely necessary.

User can perform the [`applyOps`](https://www.mongodb.com/docs/manual/reference/command/applyops.md#mongodb-dbcommand-dbcmd.applyOps) command. Apply this action to a `cluster` resource.
