Docs Menu
Docs Home
/
MongoDB Manual
/ / /

sh.abortReshardCollection()

On this page

  • Definition
  • Compatibility
  • Syntax
  • Example
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.

Important

mongosh Method

This page documents a mongosh method. This is not the documentation for database commands or language-specific drivers, such as Node.js.

For the database command, see the abortReshardCollection command.

For MongoDB API drivers, refer to the language-specific MongoDB driver documentation.

This method is available in deployments hosted in the following environments:

  • MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud

Important

This command is not supported in M0, M2, and M5 clusters. For more information, see Unsupported Commands.

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

sh.abortReshardCollection( <namespace> )

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

Parameter
Type
Description

String

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

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

sh.abortReshardCollection("sales.orders")

Tip

See also:

Back

sh.abortMoveCollection