Courseiva
CRUD Operations →hardMultiple Select

C100DEV CRUD Operations Practice Question

A financial application stores transactions in the 'transactions' collection. Each document has fields: 'accountId', 'amount', 'timestamp', and 'status'. You need to find all transactions for account 'A123' that have an amount greater than 1000 and a status of either 'pending' or 'review'. Which two query documents correctly retrieve these transactions? (Choose two.)

⚠ Common exam trap

The trap here is mixing up $in and $or, or using $or at the top level instead of within a field, which changes the logic to OR instead of AND.

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

✓

{ accountId: 'A123', $and: [ { amount: { $gt: 1000 } }, { status: { $in: ['pending', 'review'] } } ] }

The correct queries must combine accountId, amount greater than 1000, and status in a list using logical AND. The implicit AND version and the explicit $and version both achieve this. The other options either use invalid syntax, combine conditions with OR instead of AND, or use the wrong comparison operator, leading to incorrect results.

Answer analysis

Option-by-option breakdown

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

  • ✓

    { accountId: 'A123', $and: [ { amount: { $gt: 1000 } }, { status: { $in: ['pending', 'review'] } } ] }

    Why this is correct

    This query uses the $and operator to explicitly combine the amount and status conditions, while accountId is specified at the top level. It is functionally equivalent to the implicit AND version and correctly retrieves the desired transactions. It is more verbose but valid and clear.

  • ✓

    { accountId: 'A123', amount: { $gt: 1000 }, status: { $in: ['pending', 'review'] } }

    Why this is correct

    This query uses $gt for amount and $in for status, correctly filtering transactions for account 'A123' with amount over 1000 and status in the given list. It combines conditions with implicit AND, which is exactly what is needed. It is a straightforward and efficient way to express the query.

  • ✗

    { accountId: 'A123', amount: { $gt: 1000 }, status: { $or: ['pending', 'review'] } }

    Why it's wrong here

    $or is a logical operator that takes an array of expressions, not a field-level operator like $in. Using $or as a value for status is invalid syntax; MongoDB will throw an error. The correct operator for matching any value in a list is $in. This query would not execute.

  • ✗

    { accountId: 'A123', amount: { $gte: 1000 }, status: { $in: ['pending', 'review'] } }

    Why it's wrong here

    This query uses $gte (greater than or equal) instead of $gt (greater than). It would include transactions with amount exactly 1000, which should be excluded because the requirement is amount greater than 1000. This subtle difference would return extra documents, making it incorrect.

  • ✗

    { accountId: 'A123', $or: [ { amount: { $gt: 1000 } }, { status: { $in: ['pending', 'review'] } } ] }

    Why it's wrong here

    This query uses $or at the top level, meaning it will match documents that either have amount > 1000 OR status in the list, not both. It would return transactions that meet only one condition, which is incorrect. The requirement is to find transactions that satisfy both conditions simultaneously.

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.