MongoDB card reviewhard

What is explain() in MongoDB?

The explain() method provides information about how MongoDB executes a query. It shows query plans, index usage, execution time, and document scanning details. Developers use it to optimize slow queries.

JB

Jeevan Bhargav

Audited by Creator

This answer is calibrated for technical interviews. Verify benchmarks in local sandboxes before deploying.