Show the execution plan for a `find()` query.
Section: Explain and tune
Explain a query
javascript
javascript
db.orders.find({ status: "paid" }).sort({ created_at: -1 }).explain("executionStats")Explanation
`executionStats` gives practical detail such as scanned docs, scanned keys, and returned docs.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Explain and tune
Force a specific index with hint
Test how a query behaves with a chosen index.
Hide an index for testing
Temporarily hide an index from the planner.
Inspect collection stats
View storage and index metrics for a collection.
Create a compound index
Index fields used together in filters or sorts.