Interface: Grouping<K, T>
Represents a grouping of objects based on a key within a query expression.
See Queryable.groupBy for more information.
Type Parameters
Type Parameter | Description |
---|---|
K | The type of the key. |
T | The type of the objects being grouped. |
Properties
key
readonly
key:K
The key of the grouping.
Defined in
packages/verse-core/src/query/queryable.ts:60
Methods
array()
array<
S
>(expr
?:T
extendsJoinResult
<K
> ? (...args
: readonly [K
]) =>S
: (obj
:T
) =>S
):S
[]
Returns an array of the objects in the group.
Type Parameters
Type Parameter |
---|
S |
Parameters
Parameter | Type |
---|---|
expr ? | T extends JoinResult <K > ? (...args : readonly [K ]) => S : (obj : T ) => S |
Returns
S
[]
An array of the objects in the group.
Defined in
packages/verse-core/src/query/queryable.ts:106
avg()
avg(
expr
:T
extendsJoinResult
<K
> ? (...args
: readonly [K
]) =>number
: (obj
:T
) =>number
):number
Returns the average value of the specified expression for the group.
Parameters
Parameter | Type | Description |
---|---|---|
expr | T extends JoinResult <K > ? (...args : readonly [K ]) => number : (obj : T ) => number | The expression to be evaluated. |
Returns
number
The average value of the specified expression for the group.
Defined in
packages/verse-core/src/query/queryable.ts:99
count()
count():
number
Returns the count of elements in the group.
Returns
number
The count of elements in the group.
Defined in
packages/verse-core/src/query/queryable.ts:67
max()
max(
expr
:T
extendsJoinResult
<K
> ? (...args
: readonly [K
]) =>number
: (obj
:T
) =>number
):number
Returns the maximum value of the specified expression for the group.
Parameters
Parameter | Type | Description |
---|---|---|
expr | T extends JoinResult <K > ? (...args : readonly [K ]) => number : (obj : T ) => number | The expression to be evaluated. |
Returns
number
The maximum value of the specified expression for the group.
Defined in
packages/verse-core/src/query/queryable.ts:83
min()
min(
expr
:T
extendsJoinResult
<K
> ? (...args
: readonly [K
]) =>number
: (obj
:T
) =>number
):number
Returns the minimum value of the specified expression for the group.
Parameters
Parameter | Type | Description |
---|---|---|
expr | T extends JoinResult <K > ? (...args : readonly [K ]) => number : (obj : T ) => number | The expression to be evaluated. |
Returns
number
The minimum value of the specified expression for the group.
Defined in
packages/verse-core/src/query/queryable.ts:75
sum()
sum(
expr
:T
extendsJoinResult
<K
> ? (...args
: readonly [K
]) =>number
: (obj
:T
) =>number
):number
Returns the sum of the specified expression for the group.
Parameters
Parameter | Type | Description |
---|---|---|
expr | T extends JoinResult <K > ? (...args : readonly [K ]) => number : (obj : T ) => number | The expression to be evaluated. |
Returns
number
The sum of the specified expression for the group.