For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Docs Menu

cleanupReshardCollection (database command)

Deprecated since version 9.0. : cleanupReshardCollection is deprecated. To abort a resharding operation, use abortReshardCollection instead.

cleanupReshardCollection

New in version 5.0. :

The cleanupReshardCollection command cleans up metadata of a failed resharding operation. You only need to run this command if a primary failover occurred while you ran a resharding operation.

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

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

Note

This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.

The command has the following syntax:

db.adminCommand(
{
cleanupReshardCollection: "<database>.<collection>"
}
)

The following example cleans up metadata of a failed resharding operation on the sales.orders collection:

db.adminCommand({
cleanupReshardCollection: "sales.orders"
})