C100DEV Indexing Practice Question
A developer is working with a MongoDB collection that has a partial index defined as `db.products.createIndex({ price: 1 }, { partialFilterExpression: { price: { $gt: 100 } } })`. The developer runs a query `db.products.find({ price: { $lt: 50 } })`. Which of the following statements describes how MongoDB will execute this query?
⚠ Common exam trap
The trap here is assuming that a partial index can be used for any query on the indexed field, when in fact it can only be used if the query predicate is covered by or overlaps with the partial filter expression.
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
✓
MongoDB will perform a collection scan to find documents with price less than 50.
A partial index only includes a subset of documents in a collection based on a filter expression. In this case, the partial index only contains documents where `price > 100`. The query filters for `price < 50`, which does not overlap with the partial filter expression. Therefore, the index cannot be used to satisfy the query. MongoDB will perform a collection scan to find the matching documents. It will not use the partial index, nor will it return an error; it will simply choose an alternative execution plan.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
MongoDB will use the partial index to find documents with price less than 50.
Why it's wrong here
MongoDB will not use the partial index for this query because the query predicate `{ price: { $lt: 50 } }` does not match the partial filter expression `{ price: { $gt: 100 } }`. The partial index only contains entries for documents where `price` is greater than 100. Since the query is looking for prices less than 50, those documents are not in the index. Therefore, the index cannot be used to satisfy the query, and MongoDB will not use it.
- ✗
MongoDB will use the partial index but will filter out documents that do not match the query predicate.
Why it's wrong here
This is incorrect because the partial index does not contain any documents with `price < 50`. The index only has entries for `price > 100`. Therefore, if MongoDB tried to use the index, it would find no matching entries for the query. MongoDB's query planner recognizes that the partial index is not useful for this query and will not use it. It does not use the index and then filter; it simply avoids the index entirely.
- ✓
MongoDB will perform a collection scan to find documents with price less than 50.
Why this is correct
MongoDB will perform a collection scan because the partial index is not applicable to the query. The partial index only includes documents where `price > 100`, and the query is for `price < 50`. Since the query predicate does not overlap with the partial filter expression, the index cannot be used. MongoDB will fall back to a collection scan to find the matching documents, examining every document in the collection. This is less efficient but necessary because no suitable index exists for this query.
- ✗
MongoDB will return an error because the query cannot be satisfied by the partial index.
Why it's wrong here
MongoDB does not return an error when a partial index cannot be used for a query. Instead, it will simply not use the index and will choose an alternative plan, such as a collection scan. The query will still execute and return results, albeit potentially slower. Errors are not thrown for index selection; the query planner evaluates available indexes and picks the best one, or falls back to a collection scan if none are suitable.
About these practice questions
This C100DEV question is part of Courseiva's 259-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.