Docs Menu

Docs HomeMongoDB Manual

abortReshardCollection

On this page

  • Definition
  • Syntax
  • Example
abortReshardCollection

New in version 5.0.

During a resharding operation, you can abort the operation with the abortReshardCollection command.

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 abortReshardCollection command, the command returns an error.

The mongosh provides a wrapper method sh.abortReshardCollection().

The command has the following syntax:

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

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

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

Tip

See also:

←  Sharding CommandsaddShard →
Share Feedback
© 2022 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.