planCacheListFilters

On this page本页内容

Definition定义

planCacheListFilters

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

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

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

The planCacheListFilters command has the following field:planCacheListFilters命令具有以下字段:

Field字段Type类型Description描述
planCacheListFiltersstringThe 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:设置后,此注释将与此命令的记录一起显示在以下位置:

A comment can be any valid BSON type(string, integer, object, array, etc).注释可以是任何有效的BSON类型(字符串、整数、对象、数组等)

New in version 4.4.在版本4.4中新增

Returns:返回:Document listing the index filters. 列出索引筛选器的文档。See Output.请参见输出
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>,
         "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" }

Together with the sort and the projection, the query make up the query shape for the specified index filter.querysortprojection一起构成指定索引筛选器的查询形状

planCacheListFilters.filters.sort

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

Together with the query and the projection, the sort make up the query shape for the specified index filter.sortqueryprojection一起构成指定索引筛选器的查询形状

planCacheListFilters.filters.projection

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

Together with the query and the sort, the projection make up the query shape for the specified index filter.projectionquerysort一起构成指定索引筛选器的查询形状

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.为了选择最佳的查询计划,查询优化器只评估列出的索引和集合扫描。

planCacheListFilters.ok

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

Tip提示
See also: 参阅:
←  planCacheClearFiltersplanCacheSetFilter →