We're currently using metabase to analyze our data. I've run into a problem with querying with an aggregation query. I wanted all the documents where date1 is before date2. (I used 3 filters to debug my results, it should be possible to put it in 1 match filter later on)
[{
"$match": {
"date1": {
"$exists": true
}
}
}, {
"$project": {
"_id": 0,
"date1": 1,
"date2": 1
}
}, {
"$match": {
"date1": {
"$lt": "$date2"
}
}
}]
I'm always getting no results. Anybody who could help me with the query?
EDIT:
The documents looks like this:
{
_id: ObjectID,
date1: ISODate("2016-10-04T08:34:15.041Z"),
date2: ISODate("2016-10-05T08:34:15.041Z")
... some more fields that are not interesting for this query
}
There are around 50k documents in the collection.