My $lte (body.to) date: 2019-04-24T15:42:16.472Z
My $gte (body.from) date: 2019-03-25T15:42:16.472Z
My aggregation match stage:
{
$match: {
'workflow.site.completedAt': {
$exists: true
// $lte: body.from
// $gte: body.to
}
}
},
if I just have that exists there, I get:
[ { _id: null, date: 2019-04-16T14:56:36.738Z, count: 8450 } ]
I'm grouping using $last the last date object and that's how the date is formatted in the DB. So the data stored in DB is using $date and then it's an ISO string format.
Running the match stage in any combination, even just having LTE on today, I can't match/find any documents.
Data in the actual database:
"completedAt": {
"$date": "2018-09-19T14:45:29.419Z"
},