query.greaterThan('createdAt', date)
where date is a native js Date object. So would be it greaterThan
or lessThan
- that part of query doesn’t affect anything like it absent. But because I use aggregation for my request as a solution I apply match
in pipeline:
const pipeline = [
{ match: { createdAt: { $gt: date } } },
.....
];
But what can I do in simple query without aggregation?
I read something about intricacy with ISOdate and mongo but it did not clear anything. Tryed instead Date object substitute string (iso timestamp) and number (ms) - does not matter.