Courseiva
Aggregation Framework →mediumMultiple Choice

C100DEV Aggregation Framework Practice Question

Exhibit

{
  "_id": 1, 
  "tags": ["red", "blue", "green"]
}

Refer to the exhibit. Which stage should be used to transform this document into three separate documents, one for each tag?

⚠ Common exam trap

Candidates often confuse $unwind with $group or $project, mistakenly believing that projection or grouping alone can split array elements into separate individual documents.

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

✓

$unwind

The $unwind stage is designed specifically to deconstruct an array field from the input documents to output a document for each element. This is essential for operations like counting occurrences of individual array elements or calculating statistics across specific array items. Without $unwind, the $group stage would treat the entire array as a single value rather than individual components, preventing granular analysis of the array contents.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    $group

    Why it's wrong here

    The $group stage is used for aggregating data to compute sums, averages, or other metrics across a collection of documents. It does not possess the capability to deconstruct arrays into individual documents, as its primary purpose is to collapse multiple documents into a single aggregate result per group key.

  • ✓

    $unwind

    Why this is correct

    The $unwind stage serves to explode an array into individual documents. By setting preserveNullAndEmptyArrays to false, it generates one document for every item in the array, making it the perfect tool for flattening data structures so that subsequent aggregation stages can process each array element independently.

  • ✗

    $project

    Why it's wrong here

    While $project can reshape documents, it cannot multiply the number of documents in a pipeline based on array content. It is meant for field inclusion, exclusion, or computed transformation, but it remains a one-to-one mapping operation and cannot perform the expansion required to isolate individual array elements.

  • ✗

    $match

    Why it's wrong here

    The $match stage is a filtering operator used to pass only those documents that meet specified conditions. It has no functionality related to document expansion or array deconstruction; it strictly reduces the document stream rather than modifying the internal structure of the documents that successfully pass through the filter.

About these practice questions

One of 259 original C100DEV practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.