Navigation

sh.abortReshardCollection()

On this page

Definition

sh.abortReshardCollection(namespace)

New in version 5.0.

During a resharding operation, you can abort the operation with the sh.abortReshardCollection() method.

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.

The mongosh method sh.abortReshardCollection() wraps the abortReshardCollection command.

Syntax

The sh.abortReshardCollection() method has the following syntax:

sh.abortReshardCollection( <namespace> )

Parameter

The sh.abortReshardCollection() method takes the following parameter:

Parameter Type Description
namespace String

The name of the collection to shard in the form "<database>.<collection>".

Example

Abort a Resharding Operation

The following example aborts a running resharding operation on the sales.orders collection:

sh.abortReshardCollection("sales.orders")