C100DBA Application Administration Practice Question
Exhibit
{ "code": 50, "errmsg": "Exceeded memory limit for $group, but didn't allow external sort.", "ok": 0 }Refer to the exhibit. An aggregation pipeline is failing with an error. How can you modify the pipeline to allow it to process the large dataset?
⚠ Common exam trap
Students often try to solve memory limit aggregation errors by scaling up server RAM instead of using the native pipeline configuration option meant for temporary storage.
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
✓
Set 'allowDiskUse' to true in the aggregation options.
The error indicates that the group operation is exceeding the 100MB RAM limit. By setting 'allowDiskUse: true', you permit the MongoDB server to use temporary files for the aggregation process. This is a common requirement for complex analytics where the data working set is larger than the available RAM, ensuring that long-running operations can complete successfully without crashing due to memory exhaustion.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Set 'allowDiskUse' to true in the aggregation options.
Why this is correct
The allowDiskUse option explicitly authorizes the aggregation pipeline to write temporary data to the _tmp directory on the server disk when the memory limit is reached. This enables processing of datasets that exceed 100MB of RAM, effectively resolving the memory limit error.
- ✗
Increase the RAM allocated to the mongod process configuration.
Why it's wrong here
The 100MB limit for aggregation stages is a hardcoded constraint in MongoDB. Increasing the overall RAM available to the mongod process does not change this limit, meaning the error will persist regardless of the available system memory unless allowDiskUse is used.
- ✗
Remove the $group stage and perform the grouping in application code.
Why it's wrong here
Moving the grouping logic to the application is highly inefficient as it requires transferring massive amounts of raw data over the network. This increases latency and consumes application memory, which is exactly what the database aggregation framework is designed to avoid.
- ✗
Reduce the batch size in the cursor options.
Why it's wrong here
Batch size affects the data transfer rate between the server and client, but it has no impact on the internal memory usage of the aggregation pipeline stages. Reducing it will not prevent the $group memory limit error, which is an internal server-side processing constraint.
About these practice questions
Courseiva writes every C100DBA question from scratch — 222 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 C100DBA 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 C100DBA exam.