Privilege Actions权限操作
On this page本页内容
Query and Write Actions查询和写入操作Database Management Actions数据库管理操作Deployment Management Actions部署管理操作Change Stream Actions更改流操作Replication Actions复制操作Sharding Actions分片操作Server Administration Actions服务器管理操作Session Actions会话操作Atlas Search Index ActionsAtlas搜索索引操作Free Monitoring Actions免费监控操作Diagnostic Actions诊断操作Internal Actions内部操作
Privilege actions define the operations a user can perform on a resource. 权限操作定义了用户可以对资源执行的操作。A MongoDB privilege comprises a resource and the permitted actions. MongoDB权限包括一个资源和允许的操作。This page lists available actions grouped by common purpose.此页面列出了按通用目的分组的可用操作。
MongoDB provides built-in roles with pre-defined pairings of resources and permitted actions. MongoDB为内置角色提供了预定义的资源配对和允许的操作。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:用户可以执行以下命令及其等效的辅助方法:除aggregate
for all pipeline operations except$collStats
,$out
, and$indexStats
.$collStats
、$out
和$indexStats
之外的所有管道操作的聚合。checkShardingIndex
count
dataSize
distinct
filemd5
find
geoSearch
(Removed in MongoDB 5.0在MongoDB 5.0中删除)getLastError
(Removed in MongoDB 5.1在MongoDB 5.1中删除)getMore
killCursors
, provided that the cursor is associated with a currently authenticated user.,前提是游标与当前已验证的用户相关联。listCollections
listIndexes
mapReduce
with the{out: inline}
option.resetError
(Removed in MongoDB 5.0在MongoDB 5.0中删除)
Required for the query portion of the输出到集合时,mapReduce
command anddb.collection.mapReduce()
helper method when outputting to a collection.mapReduce
命令的查询部分和db.collection.mapReduce()
助手方法是必需的。Required for the query portion of thefindAndModify
command anddb.collection.findAndModify()
helper method.findAndModify
命令的查询部分和db.collection.findAndModify()
辅助方法所必需。Required on the source collection for the在cloneCollectionAsCapped
andrenameCollection
commands and thedb.collection.renameCollection()
helper method.cloneCollectionAsCapped
和renameCollection
命令以及db.collection.renameCollection()
辅助方法的源集合上是必需的。If the user does not have the如果用户没有listDatabases
privilege action, users can run thelistDatabases
command 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 withauthorizedDatabases
option unspecified or set totrue
.listDatabases
权限操作,则如果在authorizedDatabases
选项未指定或设置为true
的情况下运行该命令,则用户可以运行listDatabases
命令以返回用户具有权限的数据库列表(包括用户对特定集合具有权限的数据库)。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输出到集合时,mapReduce
command anddb.collection.mapReduce()
helper method when outputting to a collection.mapReduce
命令的输出部分和db.collection.mapReduce()
辅助方法所必需的。Required for the在使用aggregate
command anddb.collection.aggregate()
helper method when using the$out
or$merge
pipeline operator.$out
或$merge
管道运算符时,aggregate
命令和db.collection.aggregate()
辅助方法是必需的。Required for the与update
andfindAndModify
commands and equivalent helper methods when used with theupsert
option.upsert
选项一起使用时,update
和findAndModify
命令以及等效的辅助方法是必需的。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用户可以执行delete
command and equivalent helper method.delete
命令和等效的辅助方法。Required for the write portion of thefindAndModify
command anddb.collection.findAndModify()
method.findAndModify
命令和db.collection.findAndModify()
方法的写入部分所必需的。Required for the当您在输出到集合时指定替换操作时,mapReduce
command anddb.collection.mapReduce()
helper method when you specify thereplace
action when outputting to a collection.mapReduce
命令和db.collection.mapReduce()
助手方法是必需的。Required for the在使用aggregate
command anddb.collection.aggregate()
helper method when using the$out
pipeline operator.$out
管道运算符时,aggregate
命令和db.collection.aggregate()
辅助方法是必需的。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
update
-
User can perform the用户可以执行update
command and equivalent helper methods.update
命令和等效的辅助方法。Required for the在不指定替换操作的情况下输出到集合时,mapReduce
command anddb.collection.mapReduce()
helper method when outputting to a collection without specifying thereplace
action.mapReduce
命令和db.collection.mapReduce()
助手方法是必需的。Required for thefindAndModify
command anddb.collection.findAndModify()
helper method.findAndModify
命令和db.collection.findAndModify()
辅助方法所必需的。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
bypassDocumentValidation
-
Users can bypass document validation on commands and methods that support the用户可以对支持bypassDocumentValidation
option. The following commands and their equivalent methods support bypassing document validation:bypassDocumentValidation
选项的命令和方法绕过文档验证。以下命令及其等效方法支持绕过文档验证:Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
useUUID
-
User 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的集合上执行find
command 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对应的集合命名空间上执行find
command 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将此操作应用于cluster
resource.cluster
资源。
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.db.createCollection()
方法。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
createIndex
-
Provides access to the提供对db.collection.createIndex()
method and thecreateIndexes
command. Apply this action to database or collection resources.db.collection.createIndex()
方法和createIndexes
命令的访问权限。将此操作应用于数据库或集合资源。
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.db.collection.drop()
方法。将此操作应用于数据库或集合资源。
dropRole
-
User can delete any role from the given database. Apply this action to database resources.用户可以从给定的数据库中删除任何角色。将此操作应用于数据库资源。
dropUser
-
User can remove any user from the given database. Apply this action to database resources.用户可以从给定的数据库中删除任何用户。将此操作应用于数据库资源。
enableProfiler
-
User can perform the用户可以执行db.setProfilingLevel()
method. Apply this action to database resources.db.setProfilingLevel()
方法。将此操作应用于数据库资源。
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
-
Starting in MongoDB 4.2, users can always kill their own cursors, regardless of whether the users have the privilege to从MongoDB 4.2开始,用户总是可以杀死自己的游标,而不管用户是否有killCursors
.killCursors
的权限。As such, the因此,killCursors
privilege has no effect in MongoDB 4.2+.killCursors
权限在MongoDB 4.2+中没有任何作用。In MongoDB 3.6.3 through MongoDB 4.0.x, users require在MongoDB 3.6.3到MongoDB 4.0x中,当启用访问控制时,用户需要killCursors
privilege to kill their own curors when access control is enabled.killCursors
权限才能杀死自己的游标。Cursors are associated with the users at the time of cursor creation. Apply this action to collection resources.游标在创建游标时与用户相关联。将此操作应用于集合资源。
killAnyCursor
-
User can kill any cursor, even cursors created by other users.用户可以杀死任何游标,甚至是其他用户创建的游标。Apply this action to collection resources.将此操作应用于集合资源。
planCacheIndexFilter
-
User can run the用户可以运行planCacheClearFilters
,planCacheListFilters
, andplanCacheSetFilter
commands. Apply theplanCacheIndexFilter
action to collection resources.planCacheClearFilters
、planCacheListFilters
和planCacheSetFilter
命令。将planCacheIndexFilter
操作应用于集合资源。
revokeRole
-
User can remove any role from any user from any database in the system. Apply this action to database resources.用户可以从系统中的任何数据库中的任何用户中删除任何角色。将此操作应用于数据库资源。
setAuthenticationRestriction
-
User can specify the authenticationRestrictions field in the运行以下命令时,用户可以在user
document when running the following commands:user
文档中指定authenticationRestrictions
字段:User can specify the运行以下命令时,用户可以在authenticationRestrictions
field in therole
document when running the following commands:role
文档中指定authenticationRestrictions
字段:NoteThe following built-in roles grant this privilege:以下内置角色授予此权限:TheuserAdmin
role provides this privilege on the database that the role is assigned.userAdmin
角色在分配该角色的数据库上提供此权限。TheuserAdminAnyDatabase
role provides this privilege on all databases.userAdminAnyDatabase
角色为所有数据库提供此权限。
Transitively, the在传输过程中,restore
androot
roles also provide this privilege.restore
角色和root
角色也提供了此权限。Apply this action to database resources.将此操作应用于数据库资源。
setFeatureCompatibilityVersion
-
User can run the用户可以运行setFeatureCompatibilityVersion
command.setFeatureCompatibilityVersion
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
unlock
-
User can perform the用户可以执行db.fsyncUnlock()
method. Apply this action to thecluster
resource.db.fsyncUnlock()
方法。将此操作应用于cluster
资源。
Deployment Management Actions部署管理操作
authSchemaUpgrade
-
User can perform the用户可以执行authSchemaUpgrade
command. Apply this action to thecluster
resource.authSchemaUpgrade
命令。将此操作应用于cluster
资源。
cleanupOrphaned
-
User can perform the用户可以执行cleanupOrphaned
command. Apply this action to thecluster
resource.cleanupOrphaned
命令。将此操作应用于cluster
资源。
cpuProfiler
-
User can enable and use the CPU profiler. Apply this action to the用户可以启用和使用CPU探查器。将此操作应用于cluster
resource.cluster
资源。
inprog
-
User can use the用户可以使用db.currentOp()
method to return information on pending and active operations. Apply this action to thecluster
resource.db.currentOp()
方法返回有关挂起和活动操作的信息。将此操作应用于cluster
资源。
invalidateUserCache
-
Provides access to the提供对invalidateUserCache
command. Apply this action to thecluster
resource.invalidateUserCache
命令的访问权限。将此操作应用于cluster
资源。
killop
-
User can perform the用户可以执行db.killOp()
method. Apply this action to thecluster
resource.db.killOp()
方法。将此操作应用于cluster
资源。
planCacheRead
-
User can run the following operations:用户可以运行以下操作:$planCacheStats
aggregation stage.聚合阶段。
Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
planCacheWrite
-
User can perform the用户可以执行planCacheClear
command and thePlanCache.clear()
andPlanCache.clearPlansByQuery()
methods. Apply this action to database or collection resources.planCacheClear
命令以及PlanCache.clear()
和PlanCache.clearPlansByQuery()
方法。将此操作应用于数据库或集合资源。
Change Stream Actions更改流操作
changeStream
-
User with在特定集合、特定数据库中的所有非changeStream
andfind
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 for that resource.system
集合或所有数据库中的全部非system
集合上具有changeStream
和find
的用户可以打开该资源的变更流游标。
Replication Actions复制操作
appendOplogNote
-
User can append notes to the oplog. Apply this action to the用户可以在操作日志中添加注释。将此操作应用于cluster
resource.cluster
资源。
replSetConfigure
-
User can configure a replica set. Apply this action to the用户可以配置复制副本集。将此操作应用于cluster
resource.cluster
资源。
replSetGetConfig
-
User can view a replica set's configuration.用户可以查看复制副本集的配置。Provides access to the提供对replSetGetConfig
command andrs.conf()
helper method.replSetGetConfig
命令和rs.conf()
辅助方法的访问。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
replSetGetStatus
-
User can perform the用户可以执行replSetGetStatus
command. Apply this action to thecluster
resource.replSetGetStatus
命令。将此操作应用于cluster
资源。
replSetHeartbeat
-
User can perform the deprecated用户可以执行不推荐使用的replSetHeartbeat
command. Apply this action to thecluster
resource.replSetHeartbeat
命令。将此操作应用于cluster
资源。
replSetStateChange
-
User can change the state of a replica set through the用户可以通过replSetFreeze
,replSetMaintenance
,replSetStepDown
, andreplSetSyncFrom
commands. Apply this action to thecluster
resource.replSetFreeze
、replSetMaintenance
、replSetStepDown
和replSetSyncFrom
命令更改副本集的状态。将此操作应用于cluster
资源。
Sharding Actions分片操作
addShard
-
User can perform the用户可以执行addShard
command.addShard
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
checkMetadataConsistency
-
User can perform the用户可以执行checkMetadataConsistency
command.checkMetadataConsistency
命令。Apply this action to将此操作应用于cluster
, database or collection resources.cluster
、数据库或集合资源。New in version 7.0.7.0版新增。
clearJumboFlag
-
Available starting in 4.2.3 and 4.0.15从4.2.3和4.0.15开始提供Required to clear a chunk's jumbo flag using the需要使用clearJumboFlag
command. Apply this action to database or collection resources.clearJumboFlag
命令清除区块的jumbo
标志。将此操作应用于数据库或集合资源。Included in the包含在clusterManager
built-in role.clusterManager
内置角色中。
enableSharding
- Note
Resources资源Description描述Database数据库or或Collection集合Grants users privileges to perform the following operations:授予用户执行以下操作的权限:Enable sharding on a database using the使用enableSharding
command, andenableSharding
命令在数据库上启用分片,以及Shard a collection using the使用shardCollection
command.shardCollection
命令共享集合。
Cluster群集
Starting in version 4.2.2, 4.0.14, 3.6.16从版本4.2.2、4.0.14、3.6.16开始Grants users privileges to perform the following shard zone operations:授予用户执行以下分片区域操作的权限:You can also perform these shard zone operations if you have如果您在配置数据库中对适当的集合执行了find
/update
actions on the appropriate collections in theconfig
database.find
/find
/update
操作,那么您也可以执行这些分片区域操作。Refer to the specific operations for details.有关详细信息,请参阅具体操作。
refineCollectionShardKey
-
Provides privileges to refine the shard key for a sharded collection and run the提供细化分片集合的分片键并运行refineCollectionShardKey
command.refineCollectionShardKey
命令的权限。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。Included in the包含在clusterManager
built-in role.clusterManager
内置角色中。New in version 4.4.4.4版新增。
reshardCollection
-
User can perform the用户可以执行reshardCollection
command.reshardCollection
命令。Apply this action to database or collection resources.将此操作应用于数据库和集合资源。New in version 5.0.5.0版新增。
flushRouterConfig
-
User can perform the用户可以执行flushRouterConfig
command.flushRouterConfig
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
getShardMap
-
User can perform the用户可以执行getShardMap
command.getShardMap
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
getShardVersion
-
User can perform the用户可以执行getShardVersion
command.getShardVersion
命令。Apply this action to database resources.将此操作应用于数据库资源。
listShards
-
User can perform the用户可以执行listShards
command.listShards
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
moveChunk
-
User can perform the用户可以执行moveChunk
andmoveRange
commands.moveChunk
和moveRange
命令。In addition, user can perform the此外,用户可以执行movePrimary
command provided that the privilege is applied to an appropriate database resource. Apply this action to database or collection resources.movePrimary
命令,前提是将权限应用于适当的数据库资源。将此操作应用于数据库或集合资源。
removeShard
-
User can perform the用户可以执行removeShard
command. Apply this action to thecluster
resource.removeShard
命令。将此操作应用于cluster
资源。
shardedDataDistribution
-
User can perform the用户可以执行$shardedDataDistribution
aggregation pipeline stage.$shardedDataDistribution
聚合管道阶段。New in version 6.0.3.6.0.3版新增。
shardingState
-
User can perform the用户可以执行shardingState
command.shardingState
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
splitVector
-
User can perform the用户可以执行splitVector
command.splitVector
命令。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
Server Administration Actions服务器管理操作
applicationMessage
-
User can perform the用户可以执行logApplicationMessage
command.logApplicationMessage
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
bypassWriteBlockingMode
-
User can perform writes even when writes are blocked by the即使写入被setUserWriteBlockMode
command.setUserWriteBlockMode
命令阻止,用户也可以执行写入。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
closeAllDatabases
-
User can perform the deprecated用户可以执行不推荐使用的closeAllDatabases
command.closeAllDatabases
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
collMod
-
User can perform the用户可以执行collMod
command.collMod
命令。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
compact
-
User can perform the用户可以执行compact
command.compact
命令。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
compactStructuredEncryptionData
-
User can perform the用户可以执行compactStructuredEncryptionData
command.compactStructuredEncryptionData
命令。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
connPoolSync
-
User can perform the internal用户可以执行internalconnPoolSync
command.connPoolSync
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
convertToCapped
-
User can perform the用户可以执行convertToCapped
command.convertToCapped
命令。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
dropConnections
-
User can perform the用户可以执行dropConnections
command.dropConnections
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
dropDatabase
-
User can perform the用户可以执行dropDatabase
command.dropDatabase
命令。Apply this action to database resources.将此操作应用于数据库资源。
dropIndex
-
User can perform the用户可以执行dropIndexes
command.dropIndexes
命令。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
forceUUID
-
User can create a collection with a user-defined collection UUID using the用户可以使用applyOps
command.applyOps
命令创建具有用户定义的集合UUID的集合。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
fsync
-
User can perform the用户可以执行fsync
command.fsync
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
getDefaultRWConcern
-
User can issue the administrative用户可以发出管理getDefaultRWConcern
command.getDefaultRWConcern
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
getParameter
-
User can perform the用户可以执行getParameter
command.getParameter
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
hostInfo
-
Provides information about the server the MongoDB instance runs on.提供有关MongoDB实例运行的服务器的信息。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
oidReset
-
Required to reset the 5 byte random string that is used in the ObjectID.需要重置ObjectID中使用的5字节随机字符串。
logRotate
-
User can perform the用户可以执行logRotate
command.logRotate
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
reIndex
-
User can perform the用户可以执行reIndex
command.reIndex
命令。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
renameCollectionSameDB
-
Allows the user to rename collections on the current database using the允许用户使用renameCollection
command.renameCollection
命令重命名当前数据库上的集合。Apply this action to database resources.将此操作应用于数据库资源。Additionally, the user must either have此外,用户必须在源集合上有find
on the source collection or not havefind
on the destination collection.find
,或者在目标集合上没有find
。If a collection with the new name already exists, the user must also have the如果具有新名称的集合已经存在,则用户还必须对目标集合执行dropCollection
action on the destination collection.dropCollection
操作。
rotateCertificates
-
User can perform the用户可以执行rotateCertificates
command command.rotateCertificates
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
setDefaultRWConcern
-
User can issue the administrative用户可以发出管理setDefaultRWConcern
command.setDefaultRWConcern
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
setParameter
-
User can perform the用户可以执行setParameter
command.setParameter
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
setUserWriteBlockMode
-
User can perform the用户可以执行setUserWriteBlockMode
command.setUserWriteBlockMode
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
Session Actions会话操作
impersonate
-
User can perform the用户可以使用用户和killAllSessionsByPattern
command withusers
androles
pattern.roles
模式执行killAllSessionsByPattern
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。To run若要运行killAllSessionsByPattern
command, users must also havekillAnySession
privileges on the cluster resource.killAllSessionsByPattern
命令,用户还必须对群集资源具有killAnySession
权限。
listSessions
-
User can perform the用户可以对所有用户或指定用户执行$listSessions
operation or$listLocalSessions
operation for all users or specified user(s).$listSessions
操作或$listLocalSessions
操作。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
killAnySession
-
User can perform the用户可以执行killAllSessions
and thekillAllSessionsByPattern
command.killAllSessions
和killAllSessionsByPattern
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。TipSee also:另请参阅:
Atlas Search Index ActionsAtlas搜索索引操作
The following actions enable users to run Atlas Search Database Commands. These actions are only relevant for deployments hosted on MongoDB Atlas.通过以下操作,用户可以运行Atlas搜索数据库命令。这些操作仅与MongoDB Atlas上托管的部署相关。
createSearchIndexes
-
User can run the用户可以运行createSearchIndexes
database command. Apply this action to the database or collection resource.createSearchIndexes
数据库命令。将此操作应用于数据库或集合资源。
dropSearchIndex
-
User can run the用户可以运行dropSearchIndex
database command.dropSearchIndex
数据库命令。Apply this action to the database or collection resource.将此操作应用于数据库或集合资源。
listSearchIndexes
-
User can run the用户可以运行$listSearchIndexes
aggregation stage. Apply this action to the database or collection resource.$listSearchIndexes
聚合阶段。将此操作应用于数据库或集合资源。
updateSearchIndex
-
User can run the用户可以运行updateSearchIndex
database command. Apply this action to the database or collection resource.updateSearchIndex
数据库命令。将此操作应用于数据库或集合资源。
Free Monitoring Actions免费监控操作
checkFreeMonitoringStatus
-
User with this action on the对cluster
resource can check the status of Free Monitoring.cluster
资源执行此操作的用户可以检查自由监视的状态。New in version 4.0.4.0版新增。
setFreeMonitoring
-
User with this action on the对cluster
resource can enable or disable Free Monitoring.cluster
资源执行此操作的用户可以启用或禁用自由监视。New in version 4.0.4.0版新增。
Diagnostic Actions诊断操作
collStats
-
User can perform the用户可以执行collStats
command.collStats
命令。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
connPoolStats
-
User can perform the用户可以执行connPoolStats
command.connPoolStats
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
dbHash
-
User can perform the用户可以执行dbHash
command.dbHash
命令。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
dbStats
-
User can perform the用户可以执行dbStats
command.dbStats
命令。Apply this action to database resources.将此操作应用于数据库资源。
getCmdLineOpts
-
User can perform the用户可以执行getCmdLineOpts
command.getCmdLineOpts
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
getLog
-
User can perform the用户可以执行getLog
command.getLog
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
indexStats
-
User can perform the用户可以执行indexStats
command.indexStats
命令。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。Changed in version 3.0.3.0版更改。MongoDB 3.0 removes theMongoDB 3.0删除了indexStats
command.indexStats
命令。
listDatabases
-
User can perform the用户可以执行listDatabases
command.listDatabases
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。If the user does not have the如果用户没有listDatabases
privilege action, users can run thelistDatabases
command 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 withauthorizedDatabases
option unspecified or set totrue
.listDatabases
权限操作,则如果在authorizedDatabases
选项未指定或设置为true
的情况下运行该命令,则用户可以运行listDatabases
命令以返回用户具有权限的数据库列表(包括用户对特定集合具有权限的数据库)。
listCollections
-
User can perform the用户可以执行listCollections
command.listCollections
命令。Apply this action to database resources.将此操作应用于数据库资源。NoteStarting in version 4.0, user without the required privilege can run the从4.0版本开始,没有所需权限的用户可以在listCollections
command with bothauthorizedCollections
andnameOnly
options 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.在这种情况下,该命令只返回用户有权限访问的集合的名称和类型。
listIndexes
-
User can perform the用户可以执行listIndexes
command.listIndexes
命令。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
netstat
-
User can perform the用户可以执行netstat
command.netstat
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
serverStatus
-
User can perform the用户可以执行serverStatus
command.serverStatus
命令。Apply this action to the将此操作应用于cluster
resource.cluster
资源。
validate
-
User can perform the用户可以执行validate
andvalidateDBMetadata
commands.validate
和validateDBMetadata
命令。Apply this action to database or collection resources.将此操作应用于数据库或集合资源。
top
-
User can perform the用户可以执行top
command. Apply this action to thecluster
resource.top
命令。将此操作应用于cluster
资源。
Internal Actions内部行动
anyAction
-
Allows any action on a resource.允许对资源执行任何操作。Do not assign this action unless it is absolutely necessary.除非绝对必要,否则不要分配此操作。