The time periods start at a reference date, which is determind by unit. If unit is:
- A string other than
week
,$dateTrunc
uses a reference date of2000-01-01T00:00:00.00Z
. For example, if binSize is10
and unit isyear
, example time periods are: …
Accordingly the 7 day bins for the match selection are 2024-11-30 and 2024-12-07. 2024-12-07T00:00:00.00Z is the start of the next bin.
Would other units such as week
or month
be more suitable in this case ?
binSize: 7
and unit: 'day'
: Mongo playground
unit:'month'
and implicit binSize:1
: Mongo playground
unit:'week'
and implicit binSize:1
: Mongo playground