C100DEV Indexing Practice Question
A MongoDB collection contains documents with a field `tags` that is an array of strings. A developer creates an index on the `tags` field. Which of the following statements is true about the resulting index?
⚠ Common exam trap
The trap here is thinking that an array is indexed as a single value, but MongoDB creates a multikey index with an entry per array element.
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 index will contain one entry for each element in the array, and it is called a multikey index.
When you create an index on a field that contains an array, MongoDB automatically creates a multikey index. This index has separate entries for each element of the array, allowing efficient queries on individual array elements. It is not sparse by default, and it does not index only the first element. This behavior is fundamental to querying arrays in MongoDB.
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 index will only include the first element of the array to save space.
Why it's wrong here
MongoDB does not truncate arrays when indexing. It indexes every element in the array, which is necessary to support queries that search for any tag. Indexing only the first element would make queries for other tags inefficient or impossible. Therefore, this statement is incorrect.
- ✓
The index will contain one entry for each element in the array, and it is called a multikey index.
Why this is correct
When you index a field that holds an array, MongoDB automatically creates a multikey index. Each element of the array gets its own index entry, enabling efficient equality and range queries on array elements. This is the correct behavior for indexing an array field like tags.
- ✗
The index will be a sparse index by default because arrays can be empty.
Why it's wrong here
Indexes on array fields are not sparse by default. A sparse index only includes documents that have the indexed field, even if the value is null or an empty array. By default, MongoDB indexes all documents, including those with empty arrays, which would have no index entries. The sparse property must be explicitly set, so this is false.
- ✗
The index will contain one entry per document, using the entire array as the key.
Why it's wrong here
MongoDB does not index an array as a single key. Instead, it creates a multikey index with separate index entries for each element in the array. This allows efficient queries on individual array elements. Using the entire array as a key would not support queries that match a single tag, so this statement is false.
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.