GroupBy
Helper to build grouping rules for use with resource().aggregate()
Constructors
Constructor
new GroupBy():
GroupBy
Returns
GroupBy
Methods
DateTrunc()
staticDateTrunc(field,truncation,timezone?):IGroupByDateTrunc
Group by date truncation. Returns ISO date strings (YYYY-MM-DD) for each group.
Parameters
| Parameter | Type | Description |
|---|---|---|
field | string | Column name (must be DATETIME/DATE type in the resource) |
truncation | "day" | "week" | "month" | "year" | 'day' |
timezone? | string | IANA timezone name, e.g. 'Europe/Kyiv'. Defaults to 'UTC' when omitted. |
Returns
Field()
staticField(field):IGroupByField
Group by raw field value. The field value is returned as-is in the group key.
Parameters
| Parameter | Type | Description |
|---|---|---|
field | string | Column name to group by |