Hi there,
I’d like to create a chart in my dashboard where I show the number of documents created per hour in the last 24 hours (and also last week). Each document has a timestamp field with the date created. I don’t want to update the query every time.
So I would imagine a query like
{ timestamp: {$gte: {ISODate() - 7*24*60*60*1000}}}
but this is not supported.
I know things like that are possible in code. Also I found $dateSubtract, but that’s aggregation only.
I don’t seem to be able to edit the raw aggregation of the chart either, although I can view it.
Could somebody point me in the right direction? I feel like this could be a common use case.
Bests,
Canwiper