Home » Free MongoDB tools » MongoDB Explain Plan Visualizer

MongoDB Explain Plan Visualizer

Run explain on live data — visual pipeline builder, index advisor, AI query assistant. Download free trial
How to get explain output ▾

Run one of the following commands and paste the full JSON output above.

Mongo Pilot (easiest)

  1. Open Mongo Pilot and connect to your database
  2. Browse to your collection and run a query using the query builder
  3. Click the Stats button in the toolbar
  4. In the explain modal, switch to the Raw JSON tab
  5. Click Copy JSON and paste it above
Download Mongo Pilot free →

mongosh

db.myCollection.find({ status: "active" }).explain("executionStats")

Node.js (official driver)

const plan = await db
  .collection("myCollection")
  .find({ status: "active" })
  .explain("executionStats");
console.log(JSON.stringify(plan, null, 2));

Python (pymongo)

import json
plan = db.my_collection.find({"status": "active"}).explain("executionStats")
print(json.dumps(plan, indent=2, default=str))

Atlas Search ($search) & Vector Search ($vectorSearch)

db.movies.explain("executionStats").aggregate([
  { $search: { text: { path: "title", query: "mongo" } } }
])

db.embeddings.explain("executionStats").aggregate([
  { $vectorSearch: {
      index: "vector_index",
      path: "embedding",
      queryVector: [<...>],
      numCandidates: 150,
      limit: 10
  }}
])

Atlas explain returns a stages array (mongot / Lucene). Use executionStats or allPlansExecution for timing on Lucene nodes. Search explain · Vector explain.

Use executionStats (not queryPlanner) to get per-stage metrics and efficiency data.

Stop running explain() in the terminal. Mongo Pilot connects to your database and runs explain visually — with live stage metrics, index advisor, and AI query suggestions.
Download Mongo Pilot — free trial Mac · Windows · Linux

The smartest MongoDB GUI

MongoPilot empowers developers to manage MongoDB databases effortlessly with a local LLM for AI-driven queries and an intuitive visual query builder.

Mongo Pilot, smart MongoDB GUI

MongoDB GUI

Smart MongoDB GUI with AI capabilities