Skip to main content

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 ParameterDescription
KThe type of the key.
TThe 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 extends JoinResult<K> ? (...args: readonly [K]) => S : (obj: T) => S): S[]

Returns an array of the objects in the group.

Type Parameters

Type Parameter
S

Parameters

ParameterType
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 extends JoinResult<K> ? (...args: readonly [K]) => number : (obj: T) => number): number

Returns the average value of the specified expression for the group.

Parameters

ParameterTypeDescription
exprT extends JoinResult<K> ? (...args: readonly [K]) => number : (obj: T) => numberThe 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 extends JoinResult<K> ? (...args: readonly [K]) => number : (obj: T) => number): number

Returns the maximum value of the specified expression for the group.

Parameters

ParameterTypeDescription
exprT extends JoinResult<K> ? (...args: readonly [K]) => number : (obj: T) => numberThe 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 extends JoinResult<K> ? (...args: readonly [K]) => number : (obj: T) => number): number

Returns the minimum value of the specified expression for the group.

Parameters

ParameterTypeDescription
exprT extends JoinResult<K> ? (...args: readonly [K]) => number : (obj: T) => numberThe 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 extends JoinResult<K> ? (...args: readonly [K]) => number : (obj: T) => number): number

Returns the sum of the specified expression for the group.

Parameters

ParameterTypeDescription
exprT extends JoinResult<K> ? (...args: readonly [K]) => number : (obj: T) => numberThe expression to be evaluated.

Returns

number

The sum of the specified expression for the group.

Defined in

packages/verse-core/src/query/queryable.ts:91