I'm trying to use an $and within a $match and can't seem to get it correct. The syntax I'm using isn't correct.
{
"$match":
{
"$expr": {
"$and": [
{
"$match": {
"contra": {
"$exists": true
}
}
}
,
{
"$match": {
"$expr": {
"$eq": [
"$isActivation", true
]
}
}
}
]
}
}
}
Should be as simple as this:
{
"$match": {
"contractId": { "$exists": true },
"isActive": true
}
}