对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

Atlas 集群中不支持的命令

本页面在以下章节中比较了 Free 集群、Flex 集群、M10+ Atlas Core 集群和 M10+ Atlas Infinite 集群的命令支持:

Atlas requires clients to authenticate to access an Atlas cluster. Atlas provides a curated list of Database User Privileges that grant access to a subset of MongoDB commands. The tables in the Unsupported Commands section list the commands that fall outside this subset for each cluster type.

Atlas Free、Flex 和 Infinite 集群不支持适用于其他集群的所有功能。要了解详情,请参阅:

下表按集群类型列出了 Atlas 不支持的 MongoDB 命令、shell 方法和权限操作。为了确保集群的稳定性和性能,Atlas 自动执行了这些命令提供的功能。Atlas 会根据集群的层级或数据库版本限制其他命令。

表示集群类型不支持该命令。

注意

如果在 Free 集群和 Flex 集群中使用不支持的命令或无效语法,Atlas 会返回以下错误信息:

<$command> is not allowed or the syntax is incorrect,
see the Atlas documentation for more information.

要了解有关有效语法的更多信息,请参阅数据库命令

命令
Shell 方法
特权操作
Free 和 Flex
M10+ Core
M10+ Infinite

shardedFinish

命令
Shell 方法
特权操作
Free 和 Flex
M10+ Core
M10+ Infinite

copydbgetnonce

copydbsaslstart

命令
Shell 方法
特权操作
Free 和 Flex
M10+ Core
M10+ Infinite

currentOpCtx

forcerror

getDiagnosticData

getPrevError

handshake

命令
Shell 方法
特权操作
Free 和 Flex
M10+ Core
M10+ Infinite

planCacheListPlans

planCacheListQueryShapes

命令
Shell 方法
特权操作
Free 和 Flex
M10+ Core
M10+ Infinite
[1](1, 2) You can use setAllowMigrations to control the balancing of a specific collection.
[2] 只有全局写入集群不支持此命令。

注意

作为替代方案,请参阅可用的 Atlas 用户角色。

[3](1, 2) You can call getUser for your own user account.

Atlas 不支持以下命令行工具选项。 表示集群类型不支持该选项。

Atlas 支持以下命令,但有一定限制。

您可以在免费集群和 Flex 集群中有限制地运行以下命令:

命令
Limit
  • Doesn't support the $where operator.

  • Limits the count operation on the local database to the system.replset and oplog.rs collections.

Free clusters and Flex clusters don't allow the dbStats command on the local and config databases.

要了解更多信息,请参阅运行限制。

Doesn't support $where operator.

  • Doesn't support the $where operator.

  • Doesn't support the $$USER_ROLES system variable.

  • 忽略allowDiskUse 参数。

  • Limits the find operation on the local database to the oplog.rs collection.

  • Limits the find operation to using an equality condition when querying the ns field in the oplog.rs collection on the local database.

    { "ns" : "test.foo" }

只允许对下面这两个文档执行此操作:

  • { "getParameter": 1, "authSchemaVersion": 1 }

  • { "getParameter": 1, "authenticationMechanisms": 1 }

Limits the db.killOp() method to the MongoDB user who ran the operation.

Doesn't support the $$USER_ROLES system variable.

Doesn't support the $$USER_ROLES system variable.

Doesn't support the $$USER_ROLES system variable.

限制对以下字段的响应:

  • $clusterTime.clusterTime

  • $clusterTime.operationTime

  • $clusterTime.signature.hash

  • $clusterTime.signature.keyId

  • $clusterTime.signature

  • asserts.msg

  • asserts.regular

  • asserts.rollovers

  • asserts.user

  • asserts.warning

  • atlasVersion.gitVersion

  • atlasVersion.version

  • connections.available

  • connections.current

  • connections.totalCreated

  • extra_info.note

  • extra_info.page_faults

  • host

  • localTime

  • mem.bits

  • mem.mapped

  • mem.mappedWithJournal

  • mem.resident

  • mem.supported

  • mem.virtual

  • metrics.atlas.bytesInWrites

  • metrics.atlas.connectionPool.totalCreated

  • network.bytesIn

  • network.bytesOut

  • network.numRequests

  • ok

  • opcounters.command

  • opcounters.delete

  • opcounters.getmore

  • opcounters.insert

  • opcounters.query

  • opcounters.update

  • opcountersRepl.command

  • opcountersRepl.delete

  • opcountersRepl.getmore

  • opcountersRepl.insert

  • opcountersRepl.query

  • opcountersRepl.update

  • pid

  • process

  • repl.electionId

  • repl.hosts[]

  • repl.ismaster

  • repl.lastWrite.lastWriteDate

  • repl.lastWrite.majorityOpTime.t

  • repl.lastWrite.majorityOpTime.ts

  • repl.lastWrite.majorityWriteDate

  • repl.lastWrite.opTime.t

  • repl.lastWrite.opTime.ts

  • repl.me

  • repl.primary

  • repl.rbid

  • repl.secondary

  • repl.setName

  • repl.setVersion

  • repl.tags.nodeType

  • repl.tags.provider

  • repl.tags.region

  • repl.tags

  • storageEngine.backupCursorOpen

  • storageEngine.dropPendingIdents

  • storageEngine.name

  • storageEngine.oldestRequiredTimestampForCrashRecovery

  • storageEngine.persistent

  • storageEngine.readOnly

  • storageEngine.supportsCommittedReads

  • storageEngine.supportsPendingDrops

  • storageEngine.supportsSnapshotReadConcern

  • uptime

  • uptimeEstimate

  • uptimeMillis

  • version

Atlas limits the db.killOp() method to the MongoDB user who ran the operation.

Atlas doesn't support the killAllSessions command unless the database user has:

Atlas 仅支持对 M30+ 分片的 Atlas Core 集群使用以下分片命令。

Atlas limits the db.killOp() method to the MongoDB user who ran the operation.

Atlas doesn't support the killAllSessions command unless the database user has:

Atlas Infinite clusters only support the profile command when the database profiler level is 0.

如果使用案例需要访问 Atlas 数据库用户权限当前不支持的命令,请联系 Atlas 支持部门。