products with fields price and category, which query returns all products with price greater than 100 and category either 'electronics' or 'appliances'?db.products.find({ $and: [ { price: { $gt: 100 } }, { category: { $in: ['electronics', 'appliances'] } } ] })Option D uses implicit $and by specifying both conditions in the same object, which matches documents where price is greater than 100 and category is in the given list.
Option D uses $or, which matches documents where either condition is true, so it returns more documents.
Option D uses $lt (less than) for price, which is opposite of the requirement.
Option D uses $gte and $nin, which does not match the required conditions.
db.users.find({ age: { $gte: 18, $lte: 30 } })Option C repeats the age key twice in the same object, which is invalid syntax in MongoDB queries.
Option C correctly combines $gte and $lte in one object.
Option C uses $and with two separate conditions, which is valid.
Option C uses $gte and $lt correctly in one object.
Option B uses implicit $and by specifying status and $or conditions together, which is efficient and clear.
Option B uses explicit $and with $or, which works but is more verbose.
Option B repeats status inside each $or condition, which is redundant and less efficient.
Option B uses $or with status alone, which returns documents with status 'active' or score > 80 or rank < 10, not matching the requirement.
age is between 20 and 40 and verified is true, but it returns no results. Which option explains the likely cause?db.users.find({ $and: [ { age: { $gt: 20, $lt: 40 } }, { verified: true } ] })Option A correctly identifies that $gt and $lt exclude ages exactly 20 and 40, so if documents have those ages, they won't match.
Option A is partially correct but less precise than C.
Option A is false; $and is valid syntax.
Option A assumes verified is string, but usually boolean true is correct.
db.collection.find({ $or: [ { status: 'A' }, { $and: [ { qty: { $lt: 30 } }, { price: { $gt: 20 } } ] } ] }). Which statement best describes how MongoDB evaluates this query?The query uses $or with two conditions: one is status 'A', the other is an $and condition combining qty and price.
MongoDB returns documents matching either condition: status 'A' OR both qty < 30 AND price > 20.
Option A correctly describes this logic.
Options A, C, and D misunderstand the grouping and operator precedence.