planCacheListFilters
定義
planCacheListFilters
Lists the index filters associated with plan cache query shapes for a collection.
次の値を返します。 Document listing the index filters. See 出力.
クエリ設定
MongoDB 8.0以降では、インデックス フィルターを追加する 代わりに、 クエリ設定を使用します 。 インデックス フィルターは MongoDB 8.0以降非推奨です。
クエリ設定は、インデックス フィルターよりも多くの機能を持ちます。 また、インデックス フィルターは永続的ではなく、すべてのクラスター ノードに対してインデックス フィルターを簡単に作成することはできません。 クエリ設定を追加して例を探すには、 setQuerySettings
を参照してください。
互換性
このコマンドは、次の環境でホストされている配置で使用できます。
MongoDB Atlas はクラウドでの MongoDB 配置のためのフルマネージド サービスです
重要
このコマンドは、M0 、M2 、M5 、および Flex クラスターではサポートされていません。詳細については、「 サポートされていないコマンド 」を参照してください。
MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン
MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン
構文
このコマンドの構文は、次のとおりです。
db.runCommand( { planCacheListFilters: <collection> } )
コマンドフィールド
コマンドには次のフィールドがあります:
フィールド | タイプ | 説明 |
---|---|---|
| string | コレクションの名前。 |
| any | 任意。このコマンドに添付するユーザー指定のコメント。設定すると、このコメントは以下の場所にこのコマンドの記録と合わせて表示されます。
コメントには、有効な BSON 型(string, integer, object, array など)を使用できます。 |
必要なアクセス権
ユーザーには、 planCacheIndexFilter
アクションを含むアクセス権が必要です。
出力
The planCacheListFilters
command returns the document with
the following form:
{ "filters" : [ { "query" : <query> "sort" : <sort>, "projection" : <projection>, "collation" : <collation>, "indexes" : [ <index1>, ... ] }, ... ], "ok" : 1 }
planCacheListFilters.filters
The array of documents that contain the index filter information.
Each document contains the following fields:
planCacheListFilters.filters.query
The query predicate associated with this filter. Although the
query
shows the specific values used to create the index filter, the values in the predicate are insignificant; i.e. query predicates cover similar queries that differ only in the values.For instance, a
query
predicate of{ "type": "electronics", "status" : "A" }
covers the following query predicates:{ type: "food", status: "A" } { type: "utensil", status: "D" }
planCacheListFilters.filters.projection
The projection associated with this filter. Can be an empty document.
planCacheListFilters.filters.collation
The collation associated with this filter. Can be an empty document.
planCacheListFilters.filters.indexes
The array of indexes for the plan cache query shape.
The plan cache query shape is the combination of these fields:
To choose the best query plan, the query optimizer evaluates the
indexes
and the collection scan.