Hello,
I’m currently using the following $match statement in an aggregation query to exclude entries with a booking date that matches the given date. The bookings field is an array of dates. This works fine:
{
'$match': {
'bookings': {
'$not': {
'$eq': Date('Tue, 09 Aug 2022 16:00:00 GMT')
}
}
}
}
However, I need or would like to pass in an array of dates (that will have been dynamically generated). Is this possible? I’d like to do something like this:
const dates = [
'2022-09-09T16:00:00.000+00:00',
'2022-09-08T16:00:00.000+00:00',
'2022-09-10T16:00:00.000+00:00',
]
{
'$match': {
'bookings': {
'$not': {
'$eq': Date([dates])
}
}
}
}
What would be the best way of filtering/excluding against an array of data, please?
Cheers,
Matt