Docs Menu

compactStructuredEncryptionData

compactStructuredEncryptionData

Compacts documents specified in the metadata collections and deletes redundant documents.

このコマンドは、次の環境でホストされている配置で使用できます。

  • MongoDB Atlas はクラウドでの MongoDB 配置のためのフルマネージド サービスです

注意

このコマンドは、すべての MongoDB Atlas クラスターでサポートされています。すべてのコマンドに対する Atlas のサポートについては、「サポートされていないコマンド」を参照してください。

  • MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン

  • MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン

このコマンドの構文は、次のとおりです。

db.runCommand(
{
compactStructuredEncryptionData: <collection>,
compactionTokens: {
encryptedFieldPath: bindata,
...
},
}
)

このコマンドは、次のフィールドを使用します。

フィールド
タイプ
説明

compactStructuredEncryptionData

string

コレクションの名前。

compactionTokens

ドキュメント

A document that maps index fields to compaction tokens.

mongoshはラッパー メソッドdb.collection.compactStructuredEncryptionData()を提供します。

The built-in roles readWriteAnyDatabase and dbOwner provide compactStructuredEncryptionData actions on resources.

See metadata collection compaction for an example.