{
from: 'contacts',
let: { "mcontactId" : '$clientContact.contactId',
'today' : "17/10"
},
pipeline: [
{ '$match': {
$expr: {
$and: [
{ "$eq": [ "$uniqueId", "$$mcontactId" ] },
{
$or:[{"birthDate": {"$regex": '$$today'}},
{"spouseBirthdate": {"$regex":'$$today'}},
{"weddingAnniversary": {"$regex":'$$today'}}
]
}
]
}
}
}
,
{ '$project': {
'userId':1,
'uniqueId': 1,
'firstName': 1,
'lastName': 1
}
}
],
as: 'contact'
}
Not able to get desired output. Getting “Unrecognized expression ‘$regex’” error