C100DEV Aggregation Framework Practice Question
Which operator is used to calculate the average value of a numeric field in a $group stage?
⚠ Common exam trap
Candidates sometimes confuse $avg with $sum or attempt to use it as a query operator rather than an accumulator specifically designed for use within a $group stage.
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
✓
$avg
The $avg accumulator operator is used to compute the mean of all numerical values for a specific field across a group of documents. It is a fundamental tool for data analysis and reporting. Knowing how to use accumulators within the $group stage is essential for generating meaningful insights from raw data, which is a primary use case for the MongoDB Aggregation Framework.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
$mean
Why it's wrong here
The $mean operator does not exist in the MongoDB aggregation framework. Users often confuse it with standard statistical terminology, but $avg is the correct operator provided by the engine. Using an invalid operator will result in a syntax error when the pipeline is executed.
- ✗
$sum
Why it's wrong here
The $sum operator is used to add up numerical values, not to calculate the mean. While finding the average involves sum and count, $avg is the shorthand operator provided for this purpose. Using $sum alone would produce the total, which is functionally different from the average.
- ✓
$avg
Why this is correct
$avg is the standard accumulator used to calculate the arithmetic mean. It automatically handles the summation and division by the count of documents, providing a clean and efficient way to summarize numeric trends within the aggregation pipeline's grouping phase.
- ✗
$median
Why it's wrong here
The $median operator is not a standard accumulator in the aggregation framework for general use. MongoDB provides other mechanisms for finding percentiles, but $median is not the correct choice for calculating a simple average. This would lead to incorrect results or syntax errors.
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.