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权限包括资源和允许的操作。此页面列出了按共同目的分组的可用操作。
MongoDB provides built-in roles with pre-defined pairings of resources and permitted actions. For lists of the actions granted, see:MongoDB提供了具有预定义资源和允许操作配对的内置角色。有关授予的操作列表,请参阅:
To define custom roles, see:要定义自定义角色,请参阅:
Create a User-Defined Role in Self-Managed Deployments.在自我管理部署中创建用户定义角色。Create User-Defined Roles in Atlas.在Atlas中创建用户定义的角色。
Query and Write Actions查询和写入操作
findUser can perform the following commands, and their equivalent helper methods:用户可以执行以下命令及其等效的辅助方法:除aggregatefor all pipeline operations except$collStats,$out, and$indexStats.$collStats、$out和$indexStats之外的所有管道操作的聚合。countdataSizedistinctfilemd5findgetMorekillCursors, provided that the cursor is associated with a currently authenticated user.,前提是游标与当前经过身份验证的用户相关联。listCollectionslistIndexesmapReducewith the使用{out: inline}option.{out: inline}选项。
Required for the query portion of the输出到集合时,mapReducecommand anddb.collection.mapReduce()helper method when outputting to a collection.mapReduce命令的查询部分和db.collection.mapReduce()辅助方法是必需的。Required for the query portion of thefindAndModifycommand anddb.collection.findAndModify()helper method.findAndModify命令和db.collection.findAndModify()辅助方法的查询部分必需。Required on the source collection for thecloneCollectionAsCappedandrenameCollectioncommands and thedb.collection.renameCollection()helper method.cloneCollectionAsCapped和renameCollection命令以及db.collection.renameCollection()辅助方法在源集合上是必需的。If the user does not have the如果用户没有listDatabasesprivilege action, users can run thelistDatabasescommand to return a list of databases for which the user has privileges (including databases for which the user has privileges on specific collections) if the command is run withauthorizedDatabasesoption unspecified or set totrue.listDatabases权限操作,并且未指定authorizedDatabases选项或将其设置为true,则用户可以运行listDatabases命令以返回用户具有权限的数据库列表(包括用户在特定集合上具有权限的数据库)。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
insertUser 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.mapReduce命令的输出部分和db.collection.mapReduce()辅助方法是必需的。Required for the使用aggregatecommand anddb.collection.aggregate()helper method when using the$outor$mergepipeline operator.$out或$merge管道运算符时,aggregate命令和db.collection.aggregate()辅助方法都是必需的。Required for the当与updateandfindAndModifycommands and equivalent helper methods when used with theupsertoption.upsert选项一起使用时,update和findAndModify命令以及等效的辅助方法都是必需的。Required on the destination collection for the following commands and their helper methods:以下命令及其辅助方法在目标集合上是必需的:Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
removeUser can perform the用户可以执行deletecommand and equivalent helper method.delete命令和等效的辅助方法。Required for the write portion of thefindAndModifycommand anddb.collection.findAndModify()method.findAndModify命令和db.collection.findAndModify()方法的写入部分必需。Required for the当您在输出到集合时指定替换操作时,mapReducecommand anddb.collection.mapReduce()helper method when you specify thereplaceaction when outputting to a collection.mapReduce命令和db.collection.mapReduce()辅助方法都是必需的。Required for the使用aggregatecommand anddb.collection.aggregate()helper method when using the$outpipeline operator.$out管道运算符时,aggregate命令和db.collection.aggregate()辅助方法都是必需的。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
updateUser can perform the用户可以执行updatecommand and equivalent helper methods.update命令和等效的辅助方法。Required for the在不指定mapReducecommand anddb.collection.mapReduce()helper method when outputting to a collection without specifying thereplaceaction.replace操作的情况下输出到集合时,mapReduce命令和db.collection.mapReduce()辅助方法都是必需的。Required for thefindAndModifycommand anddb.collection.findAndModify()helper method.findAndModify命令和db.collection.findAndModify()辅助方法必需。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
bypassDocumentValidationUsers can bypass schema validation on commands and methods that support the用户可以绕过支持bypassDocumentValidationoption. The following commands and their equivalent methods support bypassing schema validation:bypassDocumentValidation选项的命令和方法的架构验证。以下命令及其等效方法支持绕过模式验证:Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
useUUIDUser can execute the following commands using a UUID as if it were a namespace:用户可以使用UUID执行以下命令,就像它是一个命名空间一样:For example, this privilege authorizes a user to run the following command which executes a例如,此权限授权用户运行以下命令,该命令在具有给定UUID的集合上执行findcommand on a collection with the given UUID.find命令。In order to be successful, this operation also requires that the user is authorized to execute the为了成功,此操作还要求用户有权在与给定UUID对应的集合命名空间上执行findcommand on the collection namespace corresponding to the given UUID.find命令。db.runCommand({find: UUID("123e4567-e89b-12d3-a456-426655440000")})For more information on collection UUIDs, see Collections.有关集合UUID的更多信息,请参阅集合。Apply this action to the将此操作应用于clusterresource.cluster资源。
Database Management Actions数据库管理操作
changeCustomDataUser can change the custom information of any user in the given database. Apply this action to database resources.用户可以更改给定数据库中任何用户的自定义信息。将此操作应用于数据库资源。
changeOwnCustomDataUsers can change their own custom information. Apply this action to database resources. See also Change Your Password and Custom Data on Self-Managed Deployments.用户可以更改自己的自定义信息。将此操作应用于数据库资源。另请参阅关于自我管理部署的更改密码和自定义数据。
changeOwnPasswordUsers can change their own passwords. Apply this action to database resources. See also Change Your Password and Custom Data on Self-Managed Deployments.用户可以更改自己的密码。将此操作应用于数据库资源。另请参阅关于自我管理部署的更改密码和自定义数据。
changePasswordUser can change the password of any user in the given database. Apply this action to database resources.用户可以更改给定数据库中任何用户的密码。将此操作应用于数据库资源。
createCollectionUser can perform the用户可以执行db.createCollection()method. Apply this action to database or collection resources.db.createCollection()方法。将此操作应用于数据库或集合资源。
createIndexProvides access to the提供对db.collection.createIndex()method and thecreateIndexescommand. Apply this action to database or collection resources.db.collection.createIndex()方法和createIndexes命令的访问。将此操作应用于数据库或集合资源。
createRoleUser can create new roles in the given database. Apply this action to database resources.用户可以在给定的数据库中创建新角色。将此操作应用于数据库资源。
createUserUser can create new users in the given database. Apply this action to database resources.用户可以在给定的数据库中创建新用户。将此操作应用于数据库资源。
dropCollectionUser can perform the用户可以执行db.collection.drop()method. Apply this action to database or collection resources.db.collection.drop()方法。将此操作应用于数据库或集合资源。
dropRoleUser can delete any role from the given database. Apply this action to database resources.用户可以从给定的数据库中删除任何角色。将此操作应用于数据库资源。
dropUserUser can remove any user from the given database. Apply this action to database resources.用户可以从给定的数据库中删除任何用户。将此操作应用于数据库资源。
enableProfilerUser can perform the用户可以执行db.setProfilingLevel()method. Apply this action to database resources.db.setProfilingLevel()方法。将此操作应用于数据库资源。
grantRoleUser can grant any role in the database to any user from any database in the system. Apply this action to database resources.用户可以将数据库中的任何角色授予系统中任何数据库的任何用户。将此操作应用于数据库资源。
killCursorsUsers can always terminate their own cursors, regardless of whether the users have the privilege to用户始终可以终止自己的游标,无论用户是否有权killCursors.killCursors。
killAnyCursorUser can kill any cursor, even cursors created by other users. Apply this action to collection resources.用户可以杀死任何游标,甚至是其他用户创建的游标。将此操作应用于集合资源。
planCacheIndexFilterUser can run the用户可以运行planCacheClearFilters,planCacheListFilters, andplanCacheSetFiltercommands. Apply theplanCacheIndexFilteraction to collection resources.planCacheClearFilters、planCacheListFilters和planCacheSetFilter命令。将planCacheIndexFilter操作应用于集合资源。
querySettingsUser can run the用户可以运行setQuerySettingsandremoveQuerySettingscommands, and add a$querySettingsstage to an aggregation pipeline.setQuerySettings和removeQuerySettings命令,并将$querySettings阶段添加到聚合管道中。New in version 8.0.在版本8.0中新增。
revokeRoleUser can remove any role from any user from any database in the system. Apply this action to database resources.用户可以从系统中的任何数据库中删除任何用户的任何角色。将此操作应用于数据库资源。
setAuthenticationRestrictionUser can specify the authenticationRestrictions field in the运行以下命令时,用户可以在userdocument when running the following commands:user文档中指定authenticationRestrictions字段:User can specify the运行以下命令时,用户可以在角色文档中指定authenticationRestrictionsfield in theroledocument when running the following commands:authenticationRestrictions字段:Note
The following built-in roles grant this privilege:以下内置角色授予此权限:TheuserAdminrole provides this privilege on the database that the role is assigned.userAdmin角色在分配该角色的数据库上提供此权限。TheuserAdminAnyDatabaserole provides this privilege on all databases.userAdminAnyDatabase角色在所有数据库上提供此权限。
Transitively, the在传递过程中,restoreandrootroles also provide this privilege.restore和root角色也提供了此权限。Apply this action to database resources.将此操作应用于数据库资源。
setFeatureCompatibilityVersionUser can run the用户可以运行setFeatureCompatibilityVersioncommand. Apply this action to theclusterresource.setFeatureCompatibilityVersion命令。将此操作应用于cluster资源。
unlockUser can perform the用户可以执行db.fsyncUnlock()method. Apply this action to theclusterresource.db.fsyncUnlock()方法。将此操作应用于cluster资源。
viewRoleUser can view information about any role in the given database. Apply this action to database resources.用户可以查看给定数据库中任何角色的信息。将此操作应用于数据库资源。
viewUserUser can view the information of any user in the given database. Apply this action to database resources.用户可以查看给定数据库中任何用户的信息。将此操作应用于数据库资源。
Deployment Management Actions部署管理操作
authSchemaUpgradeUser can perform the用户可以执行authSchemaUpgradecommand. Apply this action to theclusterresource.authSchemaUpgrade命令。将此操作应用于cluster资源。
cleanupOrphanedUser can perform the用户可以执行cleanupOrphanedcommand. Apply this action to theclusterresource.cleaneupOrphaned命令。将此操作应用于cluster资源。
cpuProfilerUser can enable and use the CPU profiler. Apply this action to the用户可以启用和使用CPU分析器。将此操作应用于clusterresource.cluster资源。
inprogUser can use the用户可以使用db.currentOp()method to return information on pending and active operations. Apply this action to theclusterresource.db.currentOp()方法返回挂起和活动操作的信息。将此操作应用于cluster资源。Even without the即使没有inprogprivilege, onmongodinstances, users can view their own operations by runningdb.currentOp( { "$ownOps": true } ).inprog权限,在mongod实例上,用户也可以通过运行db.currentOp( { "$ownOps": true } )来查看自己的操作。
invalidateUserCacheProvides access to the提供对invalidateUserCachecommand. Apply this action to theclusterresource.invalidateUserCache命令的访问。将此操作应用于cluster资源。
killopUser can perform the用户可以执行db.killOp()method. Apply this action to theclusterresource.db.killOp()方法。将此操作应用于cluster资源。Even without the即使没有killopprivilege, onmongodinstances, users can kill their own operations.killop权限,在mongod实例上,用户也可以终止自己的操作。
planCacheReadUser can run the following operations:用户可以运行以下操作:$planCacheStatsaggregation stage.聚合阶段。
Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
planCacheWriteUser can perform the用户可以执行planCacheClearcommand and thePlanCache.clear()andPlanCache.clearPlansByQuery()methods. Apply this action to database or collection resources.planCacheClear命令以及PlanCache.clear()和PlanCache.clearPlansByQuery()方法。将此操作应用于数据库或集合资源。
Change Stream Actions更改流操作
changeStreamUser with具有changeStreamandfindon the specific collection, all non-systemcollections in a specific database, or all non-systemcollections across all databases can open change stream cursor for that resource.changeStream的用户可以在特定集合、特定数据库中的所有非系统集合或所有数据库中的全部非系统集合上查找并打开该资源的更改流游标。
Replication Actions复制操作
appendOplogNoteUser can append notes to the oplog. Apply this action to the用户可以在oplog中添加注释。将此操作应用于clusterresource.cluster资源。
replSetConfigureUser can configure a replica set. Apply this action to the用户可以配置副本集。将此操作应用于clusterresource.cluster资源。
replSetGetConfigUser can view a replica set's configuration. Provides access to the用户可以查看副本集的配置。提供对replSetGetConfigcommand andrs.conf()helper method.replSetGetConfig命令和rs.conf()辅助方法的访问。Apply this action to the将此操作应用于clusterresource.cluster资源。
replSetGetStatusUser can perform the用户可以执行replSetGetStatuscommand. Apply this action to theclusterresource.replSetGetStatus命令。将此操作应用于cluster资源。
replSetHeartbeatUser can perform the deprecated用户可以执行已弃用的replSetHeartbeatcommand. Apply this action to theclusterresource.replSetHeartbeat命令。将此操作应用于cluster资源。
replSetStateChangeUser can change the state of a replica set through the用户可以通过replSetFreeze,replSetMaintenance,replSetStepDown, andreplSetSyncFromcommands. Apply this action to theclusterresource.replSetFreeze、replSetMaintenance、replSetStepDown和replSetSyncFrom命令更改副本集的状态。将此操作应用于cluster资源。
resyncUser can perform the deprecated用户可以执行已弃用的resynccommand. Apply this action to theclusterresource.resync命令。将此操作应用于cluster资源。
Sharding Actions分片化行为
addShardUser can perform the用户可以执行addShardcommand. Apply this action to theclusterresource.addShard命令。将此操作应用于cluster资源。
analyzeShardKeyUser can perform the用户可以执行analyzeShardKeycommand. Apply this action to the database and collection resources.analyzeShardKey命令。将此操作应用于数据库和集合资源。Included in the包含在clusterManagerandenableShardingbuilt-in roles.clusterManager中并enableSharding(启用分片)内置角色。
checkMetadataConsistencyUser can perform the用户可以执行checkMetadataConsistencycommand.checkMetadataConsistency命令。Apply this action to将此操作应用于cluster, database or collection resources.cluster、数据库或集合资源。New in version 7.0.在版本7.0中新增。
clearJumboFlagRequired to clear a chunk's jumbo flag using the需要使用clearJumboFlagcommand. Apply this action to database or collection resources.clearJumboFlag命令清除块的巨型标志。将此操作应用于数据库或集合资源。Included in the包含在clusterManagerbuilt-in role.clusterManager内置角色中。
enableSharding-
Note
Applicable Resources适用资源Resources资源Description描述Database or Collection数据库或集合Grants users privileges to perform the following operations:授予用户执行以下操作的权限:Enable sharding on a database using the使用enableShardingcommand, andenableSharding命令在数据库上启用分片,以及Shard a collection using the使用shardCollectioncommand.shardCollection命令对集合进行分片。
Cluster群集Grants users privileges to perform the following shard zone operations:授予用户执行以下分片区域操作的权限:You can also perform these shard zone operations if you have如果您在find/updateactions on the appropriate collections in theconfigdatabase. Refer to the specific operations for details.config数据库中的相应集合上有find/update操作,您也可以执行这些分片区域操作。详见具体操作。
refineCollectionShardKeyProvides privileges to refine the shard key for a sharded collection and run the提供权限以优化分片集合的分片键,并运行refineCollectionShardKeycommand. Apply this action to database or collection resources.refineCollectionShardKey命令。将此操作应用于数据库或集合资源。Included in the包含在clusterManagerbuilt-in role.clusterManager内置角色中。
moveCollectionUser can perform the用户可以执行moveCollectioncommand. Apply this action to theclusterresource.moveCollection命令。将此操作应用于cluster资源。New in version 8.0.在版本8.0中新增。
reshardCollectionUser can perform the用户可以执行reshardCollectioncommand. Apply this action to database or collection resources.reshardCollection命令。将此操作应用于数据库或集合资源。New in version 5.0.在版本5.0中新增。
unshardCollectionUser can perform the用户可以执行unshardCollectioncommand. Apply this action to theclusterresource.unshardCollection命令。将此操作应用于cluster资源。New in version 8.0.在版本8.0中新增。
flushRouterConfigUser can perform the用户可以执行flushRouterConfigcommand. Apply this action to theclusterresource.flushRouterConfig命令。将此操作应用于cluster资源。
getShardMapUser can perform the用户可以执行getShardMapcommand. Apply this action to theclusterresource.getShardMap命令。将此操作应用于cluster资源。
listShardsUser can perform the用户可以执行listShardscommand. Apply this action to theclusterresource.listShards命令。将此操作应用于cluster资源。
moveChunkUser can perform the用户可以执行moveChunkandmoveRangecommands.moveChunk和moveRange命令。In addition, user can perform the此外,如果权限应用于适当的数据库资源,用户可以执行movePrimarycommand provided that the privilege is applied to an appropriate database resource. Apply this action to database or collection resources.movePrimary命令。将此操作应用于数据库或集合资源。
removeShardUser can perform the用户可以执行removeShardcommand. Apply this action to theclusterresource.removeShard命令。将此操作应用于cluster资源。
shardedDataDistributionUser can perform the用户可以执行$shardedDataDistributionaggregation pipeline stage.$shardedDataDistribution聚合管道阶段。New in version 6.0.3.在版本6.0.3中新增。
shardingStateUser can perform the用户可以执行shardingStatecommand. Apply this action to theclusterresource.shardingState命令。将此操作应用于cluster资源。
transitionFromDedicatedConfigServerUser with this action on the对clusterresource can run thetransitionFromDedicatedConfigServercommand.cluster资源执行此操作的用户可以运行transitionFromDedicatedConfigServer命令。New in version 8.0.在版本8.0中新增。
transitionToDedicatedConfigServerUser with this action on the对clusterresource can run thetransitionToDedicatedConfigServercommand.cluster资源执行此操作的用户可以运行transitionToDedicatedConfigServer命令。New in version 8.0.在版本8.0中新增。
Server Administration Actions服务器管理操作
applicationMessageUser can perform the用户可以执行logApplicationMessagecommand. Apply this action to theclusterresource.logApplicationMessage命令。将此操作应用于cluster资源。
bypassWriteBlockingModeUser can perform writes even when writes are blocked by the即使setUserWriteBlockModecommand. Apply this action to theclusterresource.setUserWriteBlockMode命令阻止写入,用户也可以执行写入。将此操作应用于cluster资源。
bypassDefaultMaxTimeMSAll queries run by the user ignore the value of the用户运行的所有查询都忽略defaultMaxTimeMSparameter.defaultMaxTimeMS参数的值。New in version 8.0.在版本8.0中新增。
closeAllDatabasesUser can perform the deprecated用户可以执行已弃用的closeAllDatabasescommand. Apply this action to theclusterresource.closeAllDatabases命令。将此操作应用于cluster资源。
collModUser can perform the用户可以执行collModcommand. Apply this action to database or collection resources.collMod命令。将此操作应用于数据库或集合资源。
compactUser can perform the用户可以执行compactcommand andautoCompactcommands. Apply this action to database or collection resources.compact(压缩)命令和autoCompact命令。将此操作应用于数据库或集合资源。
compactStructuredEncryptionDataUser can perform the用户可以执行compactStructuredEncryptionDatacommand. Apply this action to database or collection resources.compactStructuredEncryptionData命令。将此操作应用于数据库或集合资源。
connPoolSyncUser can perform the internal用户可以执行内部connPoolSynccommand. Apply this action to theclusterresource.connPoolSync命令。将此操作应用于cluster资源。
convertToCappedUser can perform the用户可以执行convertToCappedcommand. Apply this action to database or collection resources.convertToCapped命令。将此操作应用于数据库或集合资源。
dropConnectionsUser can perform the用户可以执行dropConnectionscommand. Apply this action to theclusterresource.dropConnections命令。将此操作应用于cluster资源。
dropDatabaseUser can perform the用户可以执行dropDatabasecommand. Apply this action to database resources.dropDatabase命令。将此操作应用于数据库资源。
dropIndexUser can perform the用户可以执行dropIndexescommand. Apply this action to database or collection resources.dropIndexes命令。将此操作应用于数据库或集合资源。
forceUUIDUser can create a collection with a user-defined collection UUID using the用户可以使用applyOpscommand.applyOps命令创建具有用户定义的集合UUID的集合。Apply this action to the将此操作应用于clusterresource.cluster资源。
fsyncUser can perform the用户可以执行fsynccommand. Apply this action to theclusterresource.fsync命令。将此操作应用于cluster资源。
getDefaultRWConcernUser can issue the administrative用户可以发出管理getDefaultRWConcerncommand. Apply this action to theclusterresource.getDefaultRWConcern命令。将此操作应用于cluster资源。
getParameterUser can perform the用户可以执行getParametercommand. Apply this action to theclusterresource.getParameter命令。将此操作应用于cluster资源。
hostInfoProvides information about the server the MongoDB instance runs on. Apply this action to the提供有关MongoDB实例运行的服务器的信息。将此操作应用于clusterresource.cluster资源。
oidResetRequired to reset the 5 byte random string that is used in the ObjectID.需要重置ObjectID中使用的5字节随机字符串。
logRotateUser can perform the用户可以执行logRotatecommand. Apply this action to theclusterresource.logRotate命令。将此操作应用于cluster资源。
reIndexUser can perform the用户可以执行reIndexcommand. Apply this action to database or collection resources.reIndex命令。将此操作应用于数据库或集合资源。
renameCollectionSameDBAllows the user to rename collections on the current database using the允许用户使用renameCollectioncommand. Apply this action to database resources.renameCollection命令重命名当前数据库上的集合。将此操作应用于数据库资源。Additionally, the user must either have此外,用户必须在源集合上找到或在目标集合上没有找到。findon the source collection or not havefindon the destination collection.If a collection with the new name already exists, the user must also have the如果已存在具有新名称的集合,则用户还必须对目标集合执行dropCollectionaction on the destination collection.dropCollection操作。
rotateCertificatesUser can perform the用户可以执行rotateCertificatescommand command. Apply this action to theclusterresource.rotateCertificates命令。将此操作应用于cluster资源。
setDefaultRWConcernUser can issue the administrative用户可以发出管理setDefaultRWConcerncommand. Apply this action to theclusterresource.setDefaultRWConcern命令。将此操作应用于cluster资源。
setParameterUser can perform the用户可以执行setParametercommand. Apply this action to theclusterresource.setParameter命令。将此操作应用于cluster资源。
setUserWriteBlockModeUser can perform the用户可以执行setUserWriteBlockModecommand. Apply this action to theclusterresource.setUserWriteBlockMode命令。将此操作应用于cluster资源。
shutdownUser can perform the用户可以执行shutdowncommand. Apply this action to theclusterresource.shutdown(关机)命令。将此操作应用于cluster资源。
touchUser can perform the deprecated用户可以执行已弃用的touchcommand. Apply this action to theclusterresource.touch(触摸)命令。将此操作应用于cluster资源。
Session Actions会话操作
impersonateUser can perform the用户可以使用killAllSessionsByPatterncommand withusersandrolespattern. Apply this action to theclusterresource.users和roles模式执行killAllSessionsByPattern命令。将此操作应用于cluster资源。To run要运行killAllSessionsByPatterncommand, users must also havekillAnySessionprivileges on the cluster resource.killAllSessionsByPattern命令,用户还必须对集群资源具有killAnySession权限。
listSessionsUser can perform the用户可以对所有用户或指定用户执行$listSessionsoperation or$listLocalSessionsoperation for all users or specified user(s). Apply this action to theclusterresource.$listSessions操作或$listLocalSessions操作。将此操作应用于cluster资源。
killAnySessionUser can perform the用户可以执行killAllSessionsand thekillAllSessionsByPatterncommand. Apply this action to theclusterresource.killAllSessions和killAllSessionsByPattern命令。将此操作应用于cluster资源。Tip
MongoDB Search Index ActionsMongoDB搜索索引操作
The following actions enable users to run MongoDB Search Database Commands. 以下操作使用户能够运行MongoDB搜索数据库命令。These actions are only relevant for deployments hosted on MongoDB Atlas.这些操作仅与MongoDB Atlas上托管的部署相关。
createSearchIndexesUser can run the用户可以运行createSearchIndexesdatabase command. Apply this action to the database, collection, or view resource.createSearchIndexes数据库命令。将此操作应用于数据库、集合或视图资源。
dropSearchIndexUser can run the用户可以运行dropSearchIndexdatabase command. Apply this action to the database, collection, or view resource.dropSearchIndex数据库命令。将此操作应用于数据库、集合或视图资源。
listSearchIndexesUser can run the用户可以运行$listSearchIndexesaggregation stage. Apply this action to the database, collection, or view resource.$listSearchIndexes聚合阶段。将此操作应用于数据库、集合或视图资源。
updateSearchIndexUser can run the用户可以运行updateSearchIndexdatabase command. Apply this action to the database, collection, or view resource.updateSearchIndex数据库命令。将此操作应用于数据库、集合或视图资源。
Diagnostic Actions诊断操作
collStatsUser can perform the用户可以执行collStatscommand. Apply this action to database or collection resources.collStats命令。将此操作应用于数据库或集合资源。
connPoolStatsUser can perform the用户可以执行connPoolStatscommand. Apply this action to theclusterresource.connPoolStats命令。将此操作应用于cluster资源。
dbHashUser can perform the用户可以执行dbHashcommand. Apply this action to database or collection resources.dbHash命令。将此操作应用于数据库或集合资源。
dbStatsUser can perform the用户可以执行dbStatscommand. Apply this action to database resources.dbStats命令。将此操作应用于数据库资源。
getCmdLineOptsUser can perform the用户可以执行getCmdLineOptscommand. Apply this action to theclusterresource.getCmdLineOpts命令。将此操作应用于cluster资源。
getLogUser can perform the用户可以执行getLogcommand. Apply this action to theclusterresource.getLog命令。将此操作应用于cluster资源。
indexStatsUser can run the用户可以运行$indexStatsaggregation pipeline stage. Apply this action to database or collection resources.$indexStats聚合管道阶段。将此操作应用于数据库或集合资源。To use the要使用$indexStatsstage, users must authenticate with at least theclusterMonitorrole.$indexStats阶段,用户必须至少使用clusterMonitor角色进行身份验证。
listClusterCatalogUser can run the用户可以在$listClusterCatalogaggregation pipeline stage on theadmindatabase.admin数据库上运行$listClusterCatalog聚合管道阶段。To run要在$listClusterCatalogon theadmindatabase, users must authenticate with theclusterMonitorrole.admin数据库上运行$listClusterCatalog,用户必须使用clusterMonitor角色进行身份验证。
listDatabasesUser can perform the用户可以执行listDatabasescommand. Apply this action to theclusterresource.listDatabases命令。将此操作应用于cluster资源。If the user does not have the如果用户没有listDatabasesprivilege action, users can run thelistDatabasescommand to return a list of databases for which the user has privileges (including databases for which the user has privileges on specific collections) if the command is run withauthorizedDatabasesoption unspecified or set totrue.listDatabases权限操作,并且未指定authorizedDatabases选项或将其设置为true,则用户可以运行listDatabases命令以返回用户具有权限的数据库列表(包括用户在特定集合上具有权限的数据库)。
listCollectionsUser can perform the用户可以执行listCollectionscommand. Apply this action to database resources.listCollections命令。将此操作应用于数据库资源。Note
Users without the required privilege can run the没有所需权限的用户可以在listCollectionscommand with bothauthorizedCollectionsandnameOnlyoptions set totrue.authorizedCollections和nameOnly选项都设置为true的情况下运行listCollections命令。In this case, the command returns just the name and type of the collection(s) to which the user has privileges.在这种情况下,该命令仅返回用户有权限访问的集合的名称和类型。
listIndexesUser can perform the用户可以执行listIndexescommand. Apply this action to database or collection resources.listIndexes命令。将此操作应用于数据库或集合资源。
queryStatsReadUser can run the用户可以在不使用$queryStatsaggregation stage without thetransformIdentifiersoption.transformIdentifiers选项的情况下运行$queryStats聚合阶段。
queryStatsReadTransformedUser can run the用户可以在有或没有$queryStatsaggregation stage with or without thetransformIdentifiersoption.transformIdentifiers选项的情况下运行$queryStats聚合阶段。
serverStatusUser can perform the用户可以执行serverStatuscommand. Apply this action to theclusterresource.serverStatus命令。将此操作应用于cluster资源。
validateUser can perform the用户可以执行validateandvalidateDBMetadatacommands. Apply this action to database or collection resources.validate和validateDBMetadata命令。将此操作应用于数据库或集合资源。
Internal Actions内部行动
anyActionAllows any action on a resource. Do not assign this action unless it is absolutely necessary.允许对资源执行任何操作。除非绝对必要,否则不要指定此操作。
internalAllows internal actions. Do not assign this action unless it is absolutely necessary.允许内部操作。除非绝对必要,否则不要指定此操作。
applyOpsUser can perform the用户可以执行applyOpscommand. Apply this action to aclusterresource.applyOps命令。将此操作应用于cluster资源。