The PlanCache methods are only accessible from a collection's plan cache object. 只能从集合的计划缓存对象访问PlanCache方法。To retrieve the plan cache object, use the db.collection.getPlanCache() method.要检索计划缓存对象,请使用db.collection.getPlanCache()方法。
Note注意
For details on specific methods, including syntax and examples, click on the specific method to go to its reference page.有关特定方法的详细信息,包括语法和示例,请单击特定方法以转到其参考页面。
Clears all the cached query plans for a collection. 清除集合的所有缓存查询计划。Accessible through the plan cache object of a specific collection, i.e. db.collection.getPlanCache().clear().可通过特定集合的计划缓存对象访问,即db.collection.getPlanCache().clear()。
Clears the cached query plans for the specified query shape. 清除指定查询形状的缓存查询计划。Accessible through the plan cache object of a specific collection, i.e. db.collection.getPlanCache().clearPlansByQuery()可通过特定集合的计划缓存对象访问,即db.collection.getPlanCache().clearPlansByQuery()
Displays the methods available for a collection's query plan cache. 显示集合的查询计划缓存可用的方法。Accessible through the plan cache object of a specific collection, i.e. db.collection.getPlanCache().help().可通过特定集合的计划缓存对象访问,即db.collection.getPlanCache().help()。
Returns the plan cache information for a collection. 返回集合的计划缓存信息。Accessible through the plan cache object of a specific collection, i.e. db.collection.getPlanCache().list().可通过特定集合的计划缓存对象访问,即db.collection.getPlanCache().list()。