sh.abortReshardCollection()

On this page本页内容

Definition定义

sh.abortReshardCollection(namespace)

New in version 5.0.在版本5.0中新增

During a resharding operation, you can abort the operation with the sh.abortReshardCollection() method.重新分片操作期间,可以使用sh.abortReshardCollection()方法中止该操作。

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 sh.abortReshardCollection() method, the method returns an error.如果在运行sh.abortReshardCollection()方法之前,重新分片操作已到达提交阶段,则该方法将返回错误。

The mongosh method sh.abortReshardCollection() wraps the abortReshardCollection command.mongosh方法sh.abortReshardCollection()包装了abortReshardCollection命令。

Syntax语法

The sh.abortReshardCollection() method has the following syntax:sh.abortReshardCollection()方法具有以下语法:

sh.abortReshardCollection( <namespace> )

Parameter参数

The sh.abortReshardCollection() method takes the following parameter:sh.abortReshardCollection()方法采用以下参数:

Parameter参数Type类型Description描述
namespaceString

The name of the collection to shard in the form "<database>.<collection>".要分片的集合的名称,格式为"<database>.<collection>"

Example示例

Abort a Resharding Operation中止重新分片操作

The following example aborts a running resharding operation on the sales.orders collection:以下示例中止了对sales.orders集合正在运行的重新分片操作

sh.abortReshardCollection("sales.orders")
Tip提示
←  Sharding Methodssh.addShard() →