C100DEV Aggregation Framework Practice Question
Which aggregation operator is used to transform the shape of documents by adding, renaming, or excluding fields?
⚠ Common exam trap
Test-takers frequently confuse document shaping stages like $project with data grouping stages like $group, incorrectly attempting to aggregate total sums or averages using $project.
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
✓
$project
The $project stage is the primary tool for shaping documents within an aggregation pipeline. It allows developers to specify which fields should be included in the output, calculate new fields, or reshape existing nested documents. Mastering $project is essential for data sanitization, privacy compliance, and preparing output payloads for application consumption by excluding sensitive internal database fields.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
$match
Why it's wrong here
$match is used to filter documents to pass only the ones that match specified conditions. It does not modify the structure or fields of the documents themselves; it merely acts as a gatekeeper to determine which documents continue further down the pipeline for processing or grouping.
- ✓
$project
Why this is correct
$project is explicitly designed to reshape documents. It allows for the inclusion, exclusion, or renaming of fields and the creation of new fields based on expressions. This makes it the standard operator for defining the final structure of the result set emitted from an aggregation pipeline.
- ✗
$group
Why it's wrong here
$group is used to aggregate data based on common values in a specified field. While it can compute values using accumulators like $sum or $avg, its primary purpose is summarization and categorization, not the general-purpose field manipulation or document reshaping provided by the $project stage.
- ✗
$lookup
Why it's wrong here
$lookup performs a left outer join to another collection in the same database. While it does add a field containing the joined data, it is a specialized tool for cross-collection data retrieval and not the general-purpose document transformation operator required for renaming or excluding fields.
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 →
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.