age field, which aggregation pipeline stage will return only documents where age is exactly 30?db.users.aggregate([
{ $match: { $expr: { $eq: ["$age", 30] } } }
])Option C uses $expr with $eq to compare the age field to 30 inside the aggregation pipeline using an aggregation expression, which matches the topic.
Option C filters for ages greater than 30, not equal.
Option C filters for ages greater than 30 using $expr, not equal.
Option C matches documents where age is 30 using standard query syntax, which also works inside aggregation $match stages.
score field is greater than 80?db.scores.aggregate([
{ $match: { $expr: { $gt: ["$score", 80] } } }
])Option D correctly uses $expr with $gt to filter documents where score is greater than 80 using an aggregation expression.
Option D uses a direct query filter with $gt, which also works inside aggregation $match stages.
Option D filters for score equal to 80, not greater.
Option D filters for score exactly 80, not greater.
price is greater than 100?db.products.aggregate([
{ $match: { $expr: { $gt: ["$price", 100] } } }
])Option B is invalid because $gt expects an array of two elements inside $expr, but here it is given as two separate arguments without array brackets, causing a syntax error.
Options A, C, and D are syntactically correct.
status equals "active" in an aggregation pipeline?Option A uses a direct match on the status field, which is more efficient because it can use indexes directly.
Option A uses $expr with $eq, which is more flexible but less efficient.
Option A uses $gt which is incorrect for equality.
Option A uses $eq as a query operator inside a field filter, which is valid but redundant syntax equivalent to simple equality.
{ $match: { $expr: { $and: [ { $eq: ["$type", "A"] }, { $gt: ["$value", 10] } ] } } }. What does this stage do?The $match stage uses $expr with $and to require both conditions: type equals "A" and value is greater than 10.
Option A correctly describes this.
Option A incorrectly uses OR logic.
Option A and D describe opposite or incorrect conditions.