'mongo aggregation difference in match stage using $expr vs not using $expr
I am a bit confused as to when exactly I do need to use $expr inside a $match stage.
For example, when I want to match against a documents property of lets say "fruit" and I do
$match: {fruit: 'banana'} it returns the correct values with only fruits of bananas.
I often times read about using $match in combination with $expr and $eq which results in the same data output.
When exactly do I have to use $expr then if it works without it as well?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
