定义
兼容性
此命令可用于以下环境中托管的部署:
- 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.runCommand( { compactStructuredEncryptionData: <collection>, compactionTokens: { encryptedFieldPath: bindata, ... }, } )
命令字段
该命令接受以下字段:
字段 | 类型 | 说明 |
|---|---|---|
| 字符串 | 集合的名称。 |
| 文档 | 将索引字段映射到压实令牌的文档。 |
The mongosh provides a wrapper method db.collection.compactStructuredEncryptionData().
必需的访问权限
内置角色readWriteAnyDatabase和dbOwner提供对资源的compactStructuredEncryptionData操作。
例子
有关示例,请参阅元数据集合压实。