-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
planCacheListFilters.txt
168 lines (114 loc) · 3.83 KB
/
planCacheListFilters.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
====================
planCacheListFilters
====================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. dbcommand:: planCacheListFilters
Lists the :ref:`index filters <index-filters>` associated with
:term:`query shapes <query shape>` for a collection.
:returns:
Document listing the index filters. See
:ref:`planCacheListFilters-output`.
Query Settings
~~~~~~~~~~~~~~
.. include:: /includes/persistent-query-settings-avoid-index-filters-intro.rst
Compatibility
-------------
This command is available in deployments hosted in the following environments:
.. include:: /includes/fact-environments-atlas-only.rst
.. include:: /includes/fact-environments-atlas-support-no-free.rst
.. include:: /includes/fact-environments-onprem-only.rst
Syntax
------
The command has the following syntax:
.. code-block:: javascript
db.runCommand(
{
planCacheListFilters: <collection>
}
)
Command Fields
--------------
The command has the following fields:
.. list-table::
:header-rows: 1
:widths: 20 20 80
* - Field
- Type
- Description
* - ``planCacheListFilters``
- string
- The name of the collection.
* - ``comment``
- any
- .. include:: /includes/extracts/comment-content.rst
Required Access
---------------
A user must have access that includes the
:authaction:`planCacheIndexFilter` action.
.. _planCacheListFilters-output:
Output
------
The :dbcommand:`planCacheListFilters` command returns the document with
the following form:
.. code-block:: none
{
"filters" : [
{
"query" : <query>
"sort" : <sort>,
"projection" : <projection>,
"collation" : <collation>,
"indexes" : [
<index1>,
...
]
},
...
],
"ok" : 1
}
.. data:: planCacheListFilters.filters
The array of documents that contain the index filter information.
Each document contains the following fields:
.. data:: planCacheListFilters.filters.query
The query predicate associated with this filter. Although the
:data:`~planCacheListFilters.filters.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 :data:`~planCacheListFilters.filters.query`
predicate of ``{ "type": "electronics", "status" : "A" }`` covers
the following query predicates:
.. code-block:: javascript
{ type: "food", status: "A" }
{ type: "utensil", status: "D" }
.. data:: planCacheListFilters.filters.sort
The sort associated with this filter. Can be an empty document.
.. data:: planCacheListFilters.filters.projection
The projection associated with this filter. Can be an empty
document.
.. data:: planCacheListFilters.filters.collation
The :ref:`collation <collation>` associated with this filter. Can
be an empty document.
.. data:: planCacheListFilters.filters.indexes
The array of indexes for the :term:`query shape`.
The query shape is the combination of these fields:
- :data:`~planCacheListFilters.filters.query`
- :data:`~planCacheListFilters.filters.sort`
- :data:`~planCacheListFilters.filters.projection`
- :data:`~planCacheListFilters.filters.collation`
To choose the best query plan, the query optimizer evaluates the
:data:`~planCacheListFilters.filters.indexes` *and* the collection
scan.
.. data:: planCacheListFilters.ok
The status of the command.
.. seealso::
- :dbcommand:`planCacheClearFilters`
- :dbcommand:`planCacheSetFilter`