C100DEV Data Modeling Practice Question
A logistics company uses MongoDB to store shipment data. Each shipment document includes a status field that can be one of several values: 'pending', 'in_transit', 'delivered', 'cancelled'. The application frequently queries shipments by status and also needs to generate reports that count shipments per status. The team wants to ensure efficient queries and minimal index overhead. Which schema design consideration is most important?
⚠ Common exam trap
The trap here is over-engineering the schema by using patterns designed for variable fields or adding unnecessary compound indexes when a simple index suffices.
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
✓
Store the status as a string and create a single-field index on it.
For a field with a limited set of values that is frequently queried, a simple single-field index on that field is the most efficient and straightforward solution. It supports equality matches and aggregation for counting, and it has minimal impact on write performance. More complex patterns or compound indexes are not warranted based on the described access patterns.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use a compound index on status and shipment_date to support both filtering and sorting.
Why it's wrong here
A compound index on status and shipment_date could be useful if queries often filter by status and sort by date. However, the scenario only mentions filtering by status and counting, not sorting by date. Adding an unnecessary field to the index increases index size and write overhead without a clear benefit. The simplest index on status alone is sufficient.
- ✗
Store the status as an integer code and create a single-field index on it.
Why it's wrong here
While using an integer code can save some storage space, it reduces readability and requires application-level mapping. The performance difference between indexing a string and an integer is negligible for this use case. The added complexity of maintaining code mappings is not justified, and the scenario does not indicate a need for such optimization.
- ✗
Use the Attribute Pattern to store status as a key-value pair and index the key and value fields.
Why it's wrong here
The Attribute Pattern is overkill for a single, known field like status. It is designed for variable or unknown fields. Applying it here would complicate the schema and queries unnecessarily, and the index would be larger and less efficient than a simple index on the status field. This pattern does not provide any benefit for a fixed set of statuses.
- ✓
Store the status as a string and create a single-field index on it.
Why this is correct
Storing the status as a string and indexing it is the most straightforward and efficient approach for this scenario. A single-field index on the status field supports equality queries and can be used for counting via aggregation. It has minimal overhead and is well-suited for low-cardinality fields, though in this case the cardinality is moderate. This design is simple and aligns with MongoDB best practices.
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.