I have been reading up on some mongodb documentation and ran across some confusing terminology, namely how to differentiate when a symbol will be used as an aggregate function or as an operator.

For example, the `$size` function either calculates the number of items in an array, or checks if the number of elements in an array is equal to a number, is there any way to know what the function will do at what time? Through trial and error I discovered that the $size will throw an error unless a number is passed to it in the $match step, but is there some rule/guideline so I can know what it will do beforehand?

```
db.collection.aggregate([
  {
    $project: {
      key: 1,
      number: {
        $size: "$key"
      }
    }
  },
  {
    $match: {
      key: {
        $size: 1
      }
    }
  }
])

```