PlanCache.clear()

On this page本页内容

Definition定义

PlanCache.clear()

Removes all cached query plans for a collection.删除集合的所有缓存查询计划。

The method is only available from the plan cache object of a specific collection; i.e.该方法仅在特定集合的计划缓存对象中可用;即。

db.collection.getPlanCache().clear()

For example, to clear the cache for the orders collection:例如,要清除orders集合的缓存:

db.orders.getPlanCache().clear()

Required Access所需访问权限

On systems running with authorization, a user must have access that includes the planCacheWrite action.在使用authorization运行的系统上,用户必须具有包含planCacheWrite操作的访问权限。

←  db.collection.getPlanCache()PlanCache.clearPlansByQuery() →