I have created an aggregation-pipeline with this as match stage in Compass:
{
$and: [
{
isTrue: false,
},
{
email: {
$ne: "some-email",
},
},
{
$expr: {
$eq: [
"$namespace",
"some-namespace",
],
},
},
],
}
When I run it with explain it throws an “Internal error”, when I run it normally, it works.
If I replace the $expr with:
{ namespace : { $eq : { "some-namespace" } }
the explain command works.
Why doesn’t it work with $expr?
Are both variants the same?