On this page本页内容
planCacheClear
¶Removes cached query plans for a collection. Specify a query shape to remove cached query plans for that shape. Omit the query shape to clear all cached query plans.
The command has the following syntax:语法如下所示:
The planCacheClear
command has the following field:
query |
document | |
projection |
document | |
sort |
document | |
comment |
any |
A comment can be any valid BSON type (string, integer, object, array, etc).
|
To see the query shapes for which cached query plans exist, see List Query Shapes.
On systems running with authorization
, a user must have access that includes the planCacheWrite
action.
If a collection orders
has the following query shape:
The following operation clears the query plan cached for the shape:
The following example clears all the cached query plans for the orders
collection:
See also参阅