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()方法之前,重新分片操作已到达提交阶段,则该方法将返回错误。Important- mongosh Method- This page documents a本页记录了一个- mongoshmethod.- mongosh方法。- This is not the documentation for database commands or language-specific drivers, such as Node.js.这不是数据库命令或特定语言驱动程序(如Node.js)的文档。- For the database command, see the有关数据库命令,请参阅- abortReshardCollectioncommand.- abortReshardCollection命令。- For MongoDB API drivers, refer to the language-specific MongoDB driver documentation.有关MongoDB API驱动程序,请参阅特定语言的MongoDB驱动程序文档。- For the legacy对于遗留的- mongoshell documentation, refer to the documentation for the corresponding MongoDB Server release:- mongoshell文档,请参阅相应MongoDB Server版本的文档:
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()方法采用以下参数:
| namespace | String | "<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")