> This page location: /docs.md > /docs/development.md > /docs/manual/reference/command.md

> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

# abortReshardCollection (database command)

## Definition

**New in version 5.0**

During a [resharding operation](https://www.mongodb.com/docs/manual/core/sharding-reshard-a-collection.md#std-label-sharding-resharding), you can abort the operation with the [`abortReshardCollection`](https://www.mongodb.com/docs/manual/reference/command/abortreshardcollection.md#mongodb-dbcommand-dbcmd.abortReshardCollection) command.

You can abort a [resharding operation](https://www.mongodb.com/docs/manual/core/sharding-reshard-a-collection.md#std-label-sharding-resharding) at any point until the [commit phase](https://www.mongodb.com/docs/manual/reference/command/reshardcollection.md#std-label-resharding-commit-phase-command). If the [resharding operation](https://www.mongodb.com/docs/manual/core/sharding-reshard-a-collection.md#std-label-sharding-resharding) has reached the [commit phase](https://www.mongodb.com/docs/manual/reference/command/reshardcollection.md#std-label-resharding-commit-phase-command) before you run the [`abortReshardCollection`](https://www.mongodb.com/docs/manual/reference/command/abortreshardcollection.md#mongodb-dbcommand-dbcmd.abortReshardCollection) command, the command returns an error.

**Tip:**

In [`mongosh`](https://www.mongodb.com/docs/mongodb-shell.md#std-program-mongosh), this command can also be run through the [`sh.abortReshardCollection()`](https://www.mongodb.com/docs/manual/reference/method/sh.abortreshardcollection.md#mongodb-method-sh.abortReshardCollection)
helper method.

Helper methods are convenient for [`mongosh`](https://www.mongodb.com/docs/mongodb-shell.md#std-program-mongosh) users, but they may not return the same level of information as database commands.  In cases where the convenience is not needed or the additional return fields are required, use the database command.

## Compatibility

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

- [MongoDB Atlas](https://www.mongodb.com/docs/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.](https://www.mongodb.com/docs/atlas/unsupported-commands/)

- [MongoDB Enterprise](https://www.mongodb.com/docs/manual/administration/install-enterprise.md#std-label-install-mdb-enterprise): The subscription-based, self-managed version of MongoDB

- [MongoDB Community](https://www.mongodb.com/docs/manual/administration/install-community.md#std-label-install-mdb-community-edition): The source-available, free-to-use, and self-managed version of MongoDB

## Syntax

The command has the following syntax:

```javascript
db.adminCommand(
   {
     abortReshardCollection: "<database>.<collection>"
   }
)
```

## Example

### Abort a Resharding Operation

The following example aborts a running [resharding operation](https://www.mongodb.com/docs/manual/core/sharding-reshard-a-collection.md#std-label-sharding-resharding) on the `sales.orders` collection:

```javascript
db.adminCommand({
  abortReshardCollection: "sales.orders"
})
```

**See also:**

[Reshard a Collection](https://www.mongodb.com/docs/manual/core/sharding-reshard-a-collection.md#std-label-sharding-resharding)
