I am trying to setup a MongoDB index sync that pulls over all records where a date field is $gte
the current date. I assumed something like the following would work as it worked on the Mongo command line, but alas it pulled in 0 records:
{
"aggregate": {
"pipeline": [
{
"$match": {
"expiresAt": {
"$gte": "new Date()"
}
}
}
]
}
}
My hunch is that it's trying to do new Date()
as a string literal and not actually evaluating that function. I've also tried doing "$gte": "now"
but that doesn't work either. Is what I'm trying to do here possible?
System
Host: ElasticCloud
Elasticsearch Version: 8.6.2