Definition
planCacheListFiltersLists the index filters associated with query shapes for a collection.
The command has the following syntax:
db.runCommand( { planCacheListFilters: <collection> } ) The
planCacheListFilterscommand has the following field:FieldTypeDescriptionplanCacheListFiltersstring
The name of the collection.
commentany
Optional. A user-provided comment to attach to this command. Once set, this comment appears alongside records of this command in the following locations:
mongod log messages, in the
attr.command.cursor.commentfield.Database profiler output, in the
command.commentfield.currentOpoutput, in thecommand.commentfield.
A comment can be any valid BSON type (string, integer, object, array, etc).
New in version 4.4.
Returns: Document listing the index filters. See Output.
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.filtersThe array of documents that contain the index filter information.
Each document contains the following fields:
planCacheListFilters.filters.queryThe query predicate associated with this filter. Although the
queryshows 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
querypredicate of{ "type": "electronics", "status" : "A" }covers the following query predicates:{ type: "food", status: "A" } { type: "utensil", status: "D" } Together with the
sortand theprojection, thequerymake up the query shape for the specified index filter.
planCacheListFilters.filters.sortThe sort associated with this filter. Can be an empty document.
Together with the
queryand theprojection, thesortmake up the query shape for the specified index filter.
planCacheListFilters.filters.projectionThe projection associated with this filter. Can be an empty document.
Together with the
queryand thesort, theprojectionmake up the query shape for the specified index filter.
planCacheListFilters.filters.indexesThe array of indexes for this query shape. To choose the optimal query plan, the query optimizer evaluates only the listed
indexesand the collection scan.