MongoDB_Official
alexbevi's profile
Alex Bevilacqua@alexbevi•Feb 19
290
MongoDB's profile
Post cover image

alexbevi/mongo_explain: A Ruby/Rails tool to emit and disply explain plans for MongoDB database operations

From github.com•Feb 19•3m read time

MongoExplain is a development-only Ruby/Rails gem that monitors MongoDB operations and surfaces explain plans to help developers identify expensive or unindexed queries. It hooks into the MongoDB Ruby driver's command event monitoring to capture query shapes and generate explain plans with executionStats verbosity. Two usage modes are available: a Rails Engine integration that renders a live ActionCable overlay in the browser showing query plan cards, and a standalone console mode that emits structured log lines. Key logged fields include callsite (the exact Ruby file/line that triggered the query), operation, namespace, plan stage path, index names, and execution stats. Optional filtering via MONGO_EXPLAIN_ONLY_COLLSCAN limits output to collection scans only.

24 Impressions
alexbevi's user avatar
Alex Bevilacqua
@alexbevi
Joined Nov 7. 2024
290
MongoDB's profile

MongoDB

Verified

Lead Product Manager, Developer Experience @ MongoDB

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard