Docs 菜单

abortReshardCollection

abortReshardCollection

版本 5.0 中的新增功能

During a resharding operation, you can abort the operation with the abortReshardCollection command.

You can abort a resharding operation at any point until the commit phase. If the resharding operation has reached the commit phase before you run the abortReshardCollection command, the command returns an error.

提示

mongosh 中,该命令也可通过 sh.abortReshardCollection() 辅助方法运行。

辅助方法对 mongosh 用户来说很方便,但它们返回的信息级别可能与数据库命令不同。如果不追求方便或需要额外的返回字段,请使用数据库命令。

此命令可用于以下环境中托管的部署:

注意

所有 MongoDB Atlas 集群都支持此命令。有关 Atlas 对所有命令的支持的信息,请参阅不支持的命令

该命令具有以下语法:

db.adminCommand(
{
abortReshardCollection: "<database>.<collection>"
}
)

以下示例中止对sales.orders集合正在运行的重新分片操作

db.adminCommand({
abortReshardCollection: "sales.orders"
})

另请参阅: