Displays the query shapes for which cached query plans exist.
The query optimizer only caches the plans for those query shapes that can have more than one viable plan.
The method is only available from the
plan cache objectof a specific collection; i.e.
Returns: Array of query shape documents.
The method wraps the
The following returns the query shapes that have cached plans for the
The method returns an array of the query shapes currently in the cache. In the example, the
orders collection had cached query plans associated with the following shapes:
Not all queries automatically place a query plan in the cache.
db.collection.getPlanCache().listQueryShapes() returns an empty array if there are currently no query shapes with cached query plans.