Docs HomeMongoDB Manual

planCacheListFilters

Definition定义

planCacheListFilters

Lists the index filters associated with query shapes for a collection.列出与集合的查询形状关联的索引筛选器

Returns:返回值:Document listing the index filters. 列出索引筛选器的文档。See Output.请参见输出

Syntax语法

The command has the following syntax:该命令具有以下语法:

db.runCommand(
{
planCacheListFilters: <collection>
}
)

Command Fields命令字段

The command has the following fields:该命令包含以下字段:

Field字段Type类型Description描述
planCacheListFiltersstringThe name of the collection.集合的名称。
commentanyOptional.可选的。
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). 注释可以是任何有效的BSON类型(字符串、整数、对象、数组等)。
New in version 4.4. 4.4版新增。

Required Access所需访问权限

A user must have access that includes the planCacheIndexFilter action.用户必须具有包括planCacheIndexFilter操作的访问权限。

Output输出

The planCacheListFilters command returns the document with the following form:planCacheListFilters命令返回具有以下表单的文档:

{
"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.尽管query显示了用于创建索引筛选器的特定值,但谓词中的值并不重要;即查询谓词涵盖了仅在值上不同的类似查询。

For instance, a query predicate of { "type": "electronics", "status" : "A" } covers the following query predicates:例如,{ "type": "electronics", "status" : "A" }query谓词包含以下查询谓词:

{ type: "food", status: "A" }
{ type: "utensil", status: "D" }
planCacheListFilters.filters.sort

The sort associated with this filter. Can be an empty document.与此筛选器关联的排序。可以是空文档。

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 query shape.查询形状的索引数组

The query shape is the combination of these fields:查询形状是以下字段的组合:

To choose the best query plan, the query optimizer evaluates the indexes and the collection scan.要选择最佳查询计划,查询优化器将评估indexes和集合扫描。

planCacheListFilters.ok

The status of the command.命令的状态。

Tip

See also: 另请参阅: