MongoDB官方命令请参见MongoDB官方命令表

云数据库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

    阿里云云数据库MongoDB自主研发命令,该命令支持查看实例当前的连接情况。使用示例: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