planCacheListFilters
Definition
planCacheListFilters
Lists the index filters associated with query shapes for a collection.
Returns: Document listing the index filters. See Output.
Compatibility
This command is available in deployments hosted in the following environments:
MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
Important
This command is not supported in M0, M2, and M5 clusters. For more information, see Unsupported Commands.
MongoDB Enterprise: The subscription-based, self-managed version of MongoDB
MongoDB Community: The source-available, free-to-use, and self-managed version of MongoDB
Syntax
The command has the following syntax:
db.runCommand( { planCacheListFilters: <collection> } )
The planCacheListFilters
command has the following field:
Field | Type | Description |
---|---|---|
planCacheListFilters | string | The name of the collection. |
comment | any | Optional. A user-provided comment to attach to this command. Once set, this comment appears alongside records of this command in the following locations:
A comment can be any valid BSON type (string, integer, object, array, etc). |
Required Access
A user must have access that includes the
planCacheIndexFilter
action.
Output
The planCacheListFilters
command returns the document with
the following form:
{ "filters" : [ { "query" : <query> "sort" : <sort>, "projection" : <projection>, "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" } Together with the
sort
and theprojection
, thequery
make up the query shape for the specified index filter.
planCacheListFilters.filters.sort
The sort associated with this filter. Can be an empty document.
Together with the
query
and theprojection
, thesort
make up the query shape for the specified index filter.
planCacheListFilters.filters.projection
The projection associated with this filter. Can be an empty document.
Together with the
query
and thesort
, theprojection
make up the query shape for the specified index filter.
planCacheListFilters.filters.indexes
The array of indexes for this query shape. To choose the optimal query plan, the query optimizer evaluates only the listed
indexes
and the collection scan.