Courseiva
Aggregation Framework →easyMultiple Choice

C100DEV Aggregation Framework Practice Question

Which operator is used to perform a left outer join between two collections in an aggregation pipeline?

⚠ Common exam trap

Students often confuse $lookup with $match or $project, attempting to use projection stages to join data across separate collections.

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

✓

$lookup

The $lookup operator allows for performing an equality match between a field from the input documents and a field from the documents in another collection. It is the primary method for joining data across collections in MongoDB. Mastering $lookup is essential for developers transitioning from relational databases, as it enables the retrieval of related data while keeping the power of the aggregation framework's transformations.

Answer analysis

Option-by-option breakdown

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

  • ✗

    $join

    Why it's wrong here

    $join is not a recognized operator in MongoDB. Users familiar with SQL might expect this keyword, but MongoDB uses $lookup to achieve relational-style joins. Using $join will result in an error, as the aggregation parser will not recognize the stage identifier.

  • ✗

    $merge

    Why it's wrong here

    $merge is used for writing aggregation results into a collection, not for joining data from another collection during the pipeline execution. It is an output-oriented stage rather than a processing-oriented join stage, making it unsuitable for combining data sources during runtime.

  • ✓

    $lookup

    Why this is correct

    $lookup is the native aggregation operator that performs a left outer join. It allows you to specify the 'from' collection, the 'localField', the 'foreignField', and the 'as' alias for the resulting array, making it the correct and standard choice for cross-collection data aggregation.

  • ✗

    $unionWith

    Why it's wrong here

    $unionWith combines the results of two collections into a single result set, similar to a SQL UNION ALL. It appends documents to the stream rather than performing a join based on a key match, which is what $lookup is specifically designed to handle.

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 →

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.