Concept Flow - How MongoDB scans documents
Start Query
Check for Index
Use Index
Fetch Docs
Apply Filters
Return Results
MongoDB first checks if an index can be used. If yes, it uses the index to find documents quickly. If no index is available, it scans all documents in the collection. Then it applies filters and returns the matching documents.