MongoDB官方命令請參見MongoDB官方命令表。

云數(shù)據(jù)庫MongoDB版支持及限制命令如下表所示。

命令類型 支持 不支持
Aggregation Commands
  • aggregate
  • distinct
  • count
  • mapReduce
group
說明MongoDB 3.4版本開始不支持。
Geospatial Commands
  • geoNear
  • geoSearch
Query and Write Operation Commands
  • insert
  • update
  • delete
  • findAndModify
  • getLastError
  • getPrevError
  • resetError
  • parallelCollectionScan
eval
說明MongoDB 3.0版本開始不支持,MongoDB 4.2版本刪除該命令。
Query Plan Cache Commands
  • planCacheListFilters
  • planCacheSetFilter
  • planCacheClearFilters
  • planCacheListQueryShapes
  • planCacheListPlans
  • planCacheClear
Authentication
  • logout
  • authenticate
  • authSchemaUpgrade
  • copydbgetnonce
  • getnonce
    說明MongoDB 4.0版本開始不支持該命令。
User Management Commands
  • createUser
  • updateUser
  • dropUser
  • dropAllUsersFromDatabase
  • grantRolesToUser
  • revokeRolesFromUser
  • usersInfo
Role Management Commands
  • createRole
  • updateRole
  • dropRole
  • dropAllRolesFromDatabase
  • grantPrivilegesToRole
  • revokePrivilegesFromRole
  • grantRolesToRole
  • revokeRolesFromRole
  • rolesInfo
  • invalidateUserCache
Diagnostic Commands
  • explain
  • listDatabases
  • dbHash
  • listCommands
  • availableQueryOptions
  • buildInfo
  • collStats
  • dbStats
  • cursorInfo
  • dataSize
  • ping
  • profile
  • top
  • whatsmyuri
  • serverStatus
  • features
  • isSelf
  • validate
  • netstat
  • hostInfo
    說明mongodb_20190725_1.1.8版本開始支持,mongodb_20190409_1.1.7及之前版本不支持該命令。
  • currentConn

    阿里云云數(shù)據(jù)庫MongoDB自主研發(fā)命令,該命令支持查看實例當(dāng)前的連接情況。使用示例:db.adminCommand({currentConn:1})。

  • driverOIDTest
  • connPoolStats
  • shardConnPoolStats
  • getCmdLineOpts
  • diagLogging
Instance Administration Commands
  • renameCollection
  • dropDatabase
  • listCollections
  • drop
  • create
  • cloneCollectionAsCapped
  • convertToCapped
  • filemd5
  • createIndexes
  • listIndexes
  • dropIndexes
  • fsync
  • connectionStatus
  • collMod
  • reIndex
  • touch
  • getParameter
  • compact
  • copydb
  • clone
  • clean
  • shutdown
  • logRotate
  • repairDatabase
  • repairCursor
  • setParameter
  • connPoolSync
  • cloneCollection
Replication Commands
  • isMaster
  • applyOps
  • replSetInitiate
  • replSetFreeze
  • replSetMaintenance
  • replSetGetConfig
  • replSetRequestVotes
  • replSetReconfig
  • replSetStepDown
  • replSetSyncFrom
  • replSetElect
  • replSetUpdatePosition
  • resync
  • appendOplogNote
Sharding Commands -
  • addShard
  • removeShard
  • getShardVersion
  • setShardVersion
  • unsetSharding
  • checkShardingIndex