The task description could be more clear at: M121 -> Ch1 -> Quiz1

In the M121 -> Ch1 -> Quiz1 (that follows the Lecture: $match: Filtering documents there is an option “$match can use both query operators and aggregation expressions.”, that is a falsy answer.
Actually, $match does support both.

Proof (both aggregations below return the same result):

 // using aggregation expression
db.movies.aggregate([
  {
    $match: {
      $expr: {
        $eq: ['$rated', 'G']
      }
    },
  },
  {
    $count: 'total',
  }
]).pretty();

// using query operator
db.movies.aggregate([
  {
    $match: {
      rated: {
        $eq: 'G'
      }
    },
  },
  {
    $count: 'total',
  }
]).pretty();

Maybe it was meant “Query operators and aggregation expressions can be use both in the same $match stage”, but it is not really obvious.

Some students may fail this simple question, if they encounter it in exam. Not because they do not know the topic, but because the task is not clear enough.

1 Like

Hi @biryukvy,

Thanks for the feedback. We will look into it and make the necessary changes.

~ Shubham

Maybe this is useful for other beginners.

$expr enables aggregation operators inside the query language, but it’s not an aggregation operator.

If you try to use any aggregation operator (example $split) inside $match, it returns an error. The only way to use it, is inside $expr.

I guess this is what makes the quiz confusing.