Navigation

Explain Plans

The Explain Plan tab displays the execution plan for a query.

To view the execution plan for a query filter, click on the collection on the left hand pane, then click Explain Plan.

../_images/query-plan.png

Query Bar

Note

For query result sets larger than 1000 documents, Compass shows a sampling of the results. Otherwise, Compass shows the entire result set.

For details on sampling, see the FAQ.

From the query bar, you can specify the query. If you click Options to expand the query bar, you can also specify various options for the query.

You can type MongoDB queries into the query bar. In the query expression, you can use the various MongoDB query operators except for the $text query operator.

As you type, the Explain button is disabled and the Filter label turns red until a valid query is entered. Filter syntax requires strict extended JSON types. For details on using the query bar, see Query Bar Options.

Visual Tree

You can view the explain stages in a tree format. Each stage of the pipeline appears as a node on the tree. This makes sharded cluster outputs easier to understand and visualize.

../_images/explain-tree.png

Raw JSON

You can also view the explain details in raw JSON format:

../_images/query-plan3.png

For more information about execution plans, please see the MongoDB documentation.

←   Schema Indexes  →