Courseiva
CRUD Operations →easyMultiple Choice

C100DBA CRUD Operations Practice Question

You are a MongoDB DBA and need to retrieve all documents from the 'products' collection where the 'price' field is greater than 100 and the 'category' is 'electronics'. Which query accomplishes this?

⚠ Common exam trap

The trap here is overcomplicating with $and when implicit AND suffices, or mistakenly using $or when both conditions are required.

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

✓

db.products.find({price: {$gt: 100}, category: 'electronics'})

The implicit AND by combining field conditions in a single query document is the standard way to match documents where multiple criteria must be true. Using $and explicitly is also valid but redundant. $or would match either condition, and .filter() is not a MongoDB method.

Answer analysis

Option-by-option breakdown

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

  • ✓

    db.products.find({price: {$gt: 100}, category: 'electronics'})

    Why this is correct

    This query uses an implicit AND by specifying multiple field conditions in the query document. It matches documents where price is greater than 100 and category equals 'electronics'. This is the standard and most efficient way to combine conditions in MongoDB, as it uses the query optimizer effectively.

  • ✗

    db.products.find({$or: [{price: {$gt: 100}}, {category: 'electronics'}]})

    Why it's wrong here

    This query uses $or, which would return documents that match either condition, not both. That would include products with price > 100 regardless of category, and products in 'electronics' regardless of price. This does not meet the requirement of both conditions being true simultaneously.

  • ✗

    db.products.find({price: {$gt: 100}}).filter({category: 'electronics'})

    Why it's wrong here

    The find method does not have a .filter() method in MongoDB. This is not valid syntax. To filter results, you must include all conditions in the query document passed to find, or use aggregation. This option would result in an error.

  • ✗

    db.products.find({$and: [{price: {$gt: 100}}, {category: 'electronics'}]})

    Why it's wrong here

    While this query is functionally correct and returns the same results, it is unnecessarily verbose. The $and operator is explicit and works, but the implicit AND is preferred for simplicity and readability. The question asks which query accomplishes the task; both A and B do, but only one is the best practice. However, since A is simpler and more common, it is the correct answer.

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 →

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 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.