Docs HomeMongoDB Manual

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 mongosh method. 本页记录了一个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 abortReshardCollection command.有关数据库命令,请参阅abortReshardCollection命令。

For MongoDB API drivers, refer to the language-specific MongoDB driver documentation.有关MongoDB API驱动程序,请参阅特定语言的MongoDB驱动程序文档

For the legacy mongo shell documentation, refer to the documentation for the corresponding MongoDB Server release:对于遗留的mongoshell文档,请参阅相应MongoDB Server版本的文档:

mongo shell v4.4

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描述
namespaceStringThe 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

See also: 另请参阅:

Reshard a Collection重新分片集合