Database Manual / Reference / Database Commands / Sharding

abortMoveCollection (database command数据库命令)

Definition定义

abortMoveCollection

Stops an in-progress moveCollection operation.

New in version 8.0.在版本8.0中新增。

This command must run on the admin database.此命令必须在admin数据库上运行。

Compatibility兼容性

This command is available in deployments hosted in the following environments:此命令在以下环境中托管的部署中可用:

  • MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud:云中MongoDB部署的完全托管服务

Important

This command is not supported in M0 and Flex clusters. For more information, see Unsupported Commands.M0和Flex集群不支持此命令。有关详细信息,请参阅不支持的命令

  • MongoDB Enterprise: The subscription-based, self-managed version of MongoDB:MongoDB的基于订阅的自我管理版本
  • MongoDB Community: The source-available, free-to-use, and self-managed version of MongoDB:MongoDB的源代码可用、免费使用和自我管理版本

Syntax语法

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

Command Fields命令字段

Field字段Type类型Necessity必要性Description描述
abortMoveCollectionstring字符串Required必需Specifies the database and collection to stop moving.指定要停止移动的数据库和集合。

Examples示例

The following example stops the in-progress move of the sales.us_accounts collection to a new shard.以下示例停止了sales.us_accounts集合向新分片的移动。

db.adminCommand( {
abortMoveCollection: "sales.us_accounts"
} )

Learn More了解更多