对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

abortRewriteCollection(数据库命令)

abortRewriteCollection

停止正在进行的 rewriteCollection 操作。

8.3版本新增。

此命令可用于以下环境中托管的部署:

  • 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.

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

该命令采用以下字段:

字段
类型
必要性
说明

abortRewriteCollection

字符串

必需

指定要停止重写的数据库和集合。

abortRewriteCollection 命令需要对要停止重写的集群或数据库和集合执行 rewriteCollection 权限操作。

具有以下角色的用户也可以执行此权限操作:

考虑以下集合重写示例:

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

要停止此重写,请将数据库和集合名称传递给 abortRewriteCollection 命令:

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