支持与限制的命令 用户在连接到文档数据库后,需要关注以下支持以及限制的命令。 用户在连接到文档数据库后,需要关注以下支持以及限制的命令。更多信息,请参见MongoDB官方文档。 说明 下表所示,“√”表示当前版本支持该命令,“×”表示当前版本不支持该命令。 表 支持与限制的命令 命令类别 命令名称 3.4 4.0 4.2 备注 Aggregates Commands aggregate √ √ √ Aggregates Commands count √ √ √ Aggregates Commands distinct √ √ √ Aggregates Commands group √ √ √ Aggregates Commands mapReduce √ √ √ 在DDS实例关联参数模板中设置参数“security.javascriptEnabled”的值为“true”后,可以使用该命令。更多信息,请参见。 Geospatial Commands geoNear √ √ √ Geospatial Commands geoSearch √ √ √ Query and Write Operation Commands find √ √ √ Query and Write Operation Commands insert √ √ √ Query and Write Operation Commands update √ √ √ Query and Write Operation Commands delete √ √ √ Query and Write Operation Commands findAndModify √ √ √ Query and Write Operation Commands getMore √ √ √ Query and Write Operation Commands getLastError √ √ √ Query and Write Operation Commands resetError √ √ √ Query and Write Operation Commands getPrevError √ √ √ Query and Write Operation Commands parallelCollectionScan √ √ √ Query Plan Cache Commands planCacheListFilters √ √ √ Query Plan Cache Commands planCacheSetFilter √ √ √ Query Plan Cache Commands planCacheClearFilters √ √ √ Query Plan Cache Commands planCacheListQueryShapes √ √ √ Query Plan Cache Commands planCacheListPlans √ √ √ Query Plan Cache Commands planCacheClear √ √ √ Authentication Commands logout √ √ √ Authentication Commands authenticate √ √ √ Authentication Commands copydbgetnonce √ √ √ Authentication Commands getnonce √ √ √ Authentication Commands authSchemaUpgrade x x x 系统内部命令。 User Management Commands createUser √ √ √ User Management Commands updateUser √ √ √ User Management Commands dropUser √ √ √ User Management Commands dropAllUsersFromDatabase √ √ √ User Management Commands grantRolesToUser √ √ √ User Management Commands revokeRolesFromUser √ √ √ User Management Commands usersInfo √ √ √ Role Management Commands invalidateUserCache √ √ √ Role Management Commands createRole √ √ √ Role Management Commands updateRole √ √ √ Role Management Commands dropRole √ √ √ Role Management Commands dropAllRolesFromDatabase √ √ √ Role Management Commands grantPrivilegesToRole √ √ √ Role Management Commands revokePrivilegesFromRole √ √ √ Role Management Commands grantRolesToRole √ √ √ Role Management Commands revokeRolesFromRole √ √ √ Role Management Commands rolesInfo √ √ √ Replication Commands replSetElect x x x 系统内部命令。 Replication Commands replSetUpdatePosition x x x 系统内部命令。 Replication Commands appendOplogNote x x x 系统内部命令。 Replication Commands replSetFreeze x x x 系统内部命令。 Replication Commands replSetGetStatus √ √ √ Replication Commands replSetInitiate x x x 系统内部命令。 Replication Commands replSetMaintenance x x x 系统内部命令。 Replication Commands replSetReconfig x x x 系统内部命令。 Replication Commands replSetStepDown x x x 系统内部命令。 Replication Commands replSetSyncFrom x x x 系统内部命令。 Replication Commands replSetRequestVotes x x x 系统内部命令。 Replication Commands replSetDeclareElectionWinner x x x 系统内部命令。 Replication Commands resync x x x 系统内部命令。 Replication Commands applyOps x x x 系统内部命令。 Replication Commands isMaster √ √ √ Replication Commands replSetGetConfig x x x 系统内部命令。 Sharding Commands flushRouterConfig x x x 高危命令。 Sharding Commands addShard x x x 越权操作。 Sharding Commands addShardToZone √ √ √ Sharding Commands balancerStart √ √ √ Sharding Commands balancerStatus √ √ √ Sharding Commands balancerStop √ √ √ Sharding Commands removeShardFromZone √ √ √ Sharding Commands updateZoneKeyRange √ √ √ Sharding Commands cleanupOrphaned x x x 高危命令。 Sharding Commands checkShardingIndex x x x 系统内部命令。 Sharding Commands enableSharding √ √ √ Sharding Commands listShards x x x 系统内部命令。 Sharding Commands removeShard x x x 高危命令。 Sharding Commands getShardMap x x x 系统内部命令。 Sharding Commands getShardVersion √ √ √ Sharding Commands mergeChunks √ √ √ Sharding Commands setShardVersion x x x 系统内部命令。 Sharding Commands shardCollection √ √ √ Sharding Commands shardingState x x x 系统内部命令。 Sharding Commands unsetSharding x x x 系统内部命令。 Sharding Commands split √ √ √ Sharding Commands splitChunk √ √ √ Sharding Commands splitVector √ √ √ Sharding Commands moveChunk √ √ √ Sharding Commands movePrimary √ x √ Sharding Commands isdbgrid √ √ √ Administration Commands setFeatureCompatibilityVersion √ √ √ Administration Commands renameCollection √ √ √ Administration Commands dropDatabase √ √ √ Administration Commands listCollections √ √ √ Administration Commands drop √ √ √ Administration Commands create √ √ √ Administration Commands clone x x x 系统内部命令。 Administration Commands cloneCollection √ √ √ Administration Commands cloneCollectionAsCapped √ √ √ Administration Commands convertToCapped √ √ √ Administration Commands filemd5 √ √ √ Administration Commands createIndexes √ √ √ Administration Commands listIndexes √ √ √ Administration Commands dropIndexes √ √ √ Administration Commands fsync √ √ √ Administration Commands clean x x x 系统内部命令。 Administration Commands connPoolSync x x x 系统内部命令。 Administration Commands connectionStatus √ √ √ Administration Commands compact x x x 高危命令。 Administration Commands collMod √ √ √ Administration Commands reIndex √ √ √ Administration Commands setParameter x x x 系统配置命令。 Administration Commands getParameter √ √ √ Administration Commands repairDatabase x x x 高危命令。 Administration Commands repairCursor x x x 系统内部命令。 Administration Commands touch √ √ √ Administration Commands shutdown x x x 高危命令。 Administration Commands logRotate x x x 高危命令。 Administration Commands killOp √ √ √ Administration Commands releaseFreeMemory √ √ √ Diagnostic Commands availableQueryOptions √ √ √ Diagnostic Commands buildInfo √ √ √ Diagnostic Commands collStats √ √ √ Diagnostic Commands connPoolStats x x x 系统内部命令。 Diagnostic Commands cursorInfo x x x 系统内部命令。 Diagnostic Commands dataSize √ √ √ Diagnostic Commands dbHash x x x 系统内部命令。 Diagnostic Commands dbStats √ √ √ Diagnostic Commands diagLogging x x x 系统内部命令。 Diagnostic Commands driverOIDTest x x x 系统内部命令。 Diagnostic Commands explain √ √ √ Diagnostic Commands features √ √ √ Diagnostic Commands getCmdLineOpts x x x 系统内部命令。 Diagnostic Commands getLog x x x 系统内部命令。 Diagnostic Commands hostInfo x x x 系统内部命令。 Diagnostic Commands isSelf x x x 系统内部命令。 Diagnostic Commands listCommands √ √ √ Diagnostic Commands listDatabases √ √ √ Diagnostic Commands netstat x x x 系统内部命令。 Diagnostic Commands ping √ √ √ Diagnostic Commands profile √ √ √ Diagnostic Commands serverStatus √ √ √ Diagnostic Commands shardConnPoolStats x x x 系统内部命令。 Diagnostic Commands top √ √ √ Diagnostic Commands validate x x x 系统配置命令。 Diagnostic Commands whatsmyuri √ √ √ Internal Commands handshake x x x 系统内部命令。 Internal Commands recvChunkAbort x x x 系统内部命令。 Internal Commands recvChunkCommit x x x 系统内部命令。 Internal Commands recvChunkStart x x x 系统内部命令。 Internal Commands recvChunkStatus x x x 系统内部命令。 Internal Commands replSetFresh x x x 系统内部命令。 Internal Commands mapreduce.shardedfinish x x x 系统内部命令。 Internal Commands transferMods x x x 系统内部命令。 Internal Commands replSetHeartbeat x x x 系统内部命令。 Internal Commands replSetGetRBID x x x 系统内部命令。 Internal Commands migrateClone x x x 系统内部命令。 Internal Commands replSetElect x x x 系统内部命令。 Internal Commands writeBacksQueued x x x 系统内部命令。 Internal Commands writebacklisten x x x 系统内部命令。 System Events Auditing Commands logApplicationMessage x x x 系统内部命令。