自版本 9.0 起已弃用: cleanupReshardCollection is deprecated. To abort a resharding operation, use abortReshardCollection instead.
定义
cleanupReshardCollection版本 5.0 中的新增功能。
The
cleanupReshardCollectioncommand 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.
兼容性
此命令可用于以下环境中托管的部署:
- MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
注意
This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.
MongoDB Enterprise:基于订阅、自我管理的 MongoDB 版本
MongoDB Community:源代码可用、免费使用且可自行管理的 MongoDB 版本
语法
该命令具有以下语法:
db.adminCommand( { cleanupReshardCollection: "<database>.<collection>" } )
例子
清理失败的重新分片操作
以下示例清除失败的重新分片操作的元数据在collection sales.orders上:
db.adminCommand({ cleanupReshardCollection: "sales.orders" })
提示