C100DEV Indexing Practice Question
A developer is working with a MongoDB collection that stores user profiles. The collection has an index on the `email` field. The developer runs a query to find a user by email and then examines the query plan using `explain()`. The output shows that the query used an `IXSCAN` stage. What does this indicate about the query execution?
⚠ Common exam trap
Many candidates confuse `IXSCAN` with `COLLSCAN` or assuming that `IXSCAN` implies a full collection scan, when in fact it indicates the use of an index.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The query used the index to find the matching documents without scanning the entire collection.
The `IXSCAN` stage in the explain output signifies that MongoDB used an index scan to retrieve the documents matching the query. This is the expected behavior when querying on an indexed field like `email`. It means the query did not perform a full collection scan, which would be indicated by `COLLSCAN`. Using an index allows MongoDB to efficiently locate the relevant documents, reducing the number of documents examined and improving query performance.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The query returned all documents from the collection because the index was not selective.
Why it's wrong here
An `IXSCAN` does not mean all documents were returned; it means the index was used to locate documents matching the query predicate. If the index was not selective, the query might still use the index but examine many index keys, but it would not return all documents unless the query predicate matched all documents. The scenario implies a specific email lookup, so the index would be selective. This option misinterprets the meaning of `IXSCAN`.
- ✗
The query used the index to sort the results but still had to scan the collection to filter documents.
Why it's wrong here
If the query used an index for sorting but still scanned the collection for filtering, the explain output would typically show a `COLLSCAN` stage combined with a `SORT` stage, or a `FETCH` stage after an `IXSCAN`. However, an `IXSCAN` alone indicates that the index was used for filtering. The scenario states the query filters by email, and the index is on email, so the index was used for filtering, not just sorting.
- ✓
The query used the index to find the matching documents without scanning the entire collection.
Why this is correct
An `IXSCAN` stage in the explain output indicates that MongoDB used an index scan to satisfy the query. This means the query leveraged the index on the `email` field to locate the matching documents efficiently, rather than scanning every document in the collection. This is generally the desired outcome for a query that filters on an indexed field, as it reduces the number of documents examined and improves performance.
- ✗
The query performed a collection scan because no suitable index was found.
Why it's wrong here
A collection scan is represented by a `COLLSCAN` stage in the explain output, not `IXSCAN`. If the query had performed a collection scan, it would have examined every document in the collection, which is inefficient for a query that filters on an indexed field. The presence of `IXSCAN` indicates that an index was used, so this option is incorrect.
About these practice questions
Courseiva writes every C100DEV question from scratch — 259 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official MongoDB exam blueprint
This C100DEV practice question is part of Courseiva's free MongoDB certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the C100DEV exam.