sh.moveChunk()

在本页面

Definition

Parameter Type Description
namespace string 包含要迁移的块的分片集合的namespace
query document 分片键上的相等匹配项,用于选择要移动的块。
destination string 要移动的分片的名称。

Important

在大多数情况下,允许balancer自动迁移chunks,并避免直接调用sh.moveChunk()

Example

给定records数据库中的people集合,以下操作将查找包含zipcode字段设置为53187的文档的块,然后将该块移至名为shard0019的分片:

sh.moveChunk("records.people", { zipcode: "53187" }, "shard0019")
首页