Docs 菜单

Docs 主页开发应用程序MongoDB Manual

setAllowMigrations

在此页面上

  • 定义
  • 行为
  • 例子
setAllowMigrations

版本5中的新增功能。 0 。 6

防止在集合上启动新的自动迁移,防止提交进行中的手动迁移,并将该集合从新的负载均衡器轮次中排除。

该命令具有以下语法:

db.adminCommand( {
setAllowMigrations: "<db>.<collection>",
allowMigrations: <true|false>
} )

该命令采用以下参数:

字段
类型
说明
setAllowMigrations
string

要修改的collection。

boolean

如果为 false

  • MongoDB 禁止对collection进行新的自动迁移

  • 不会提交进行中的手动迁移

  • 该集合将被排除在新的负载均衡器轮次之外

如果为 true

  • MongoDB 支持对collection进行新的自动迁移

  • 将提交进行中的手动迁移

  • 该集合将包含在新的负载均衡器轮次中

setAllowMigrations需要与moveChunk相同的权限。

此操作会阻止在store.inventorycollection上的迁移:

db.adminCommand( {
setAllowMigrations: "store.inventory",
allowMigrations: false
} )
← reshardCollection

在此页面上