TopAggregator aggregates the top N extracted values into an array. The extracted values must not be null, but do not need to be unique.

Type Parameters

  • K = any

    the type of the Map entry keys

  • V = any

    the type of the Map entry values

  • E = any

    the extracted type

Hierarchy

Constructors

  • Constructs a new TopAggregator.

    Type Parameters

    • K = any

    • V = any

    • E = any

    Parameters

    • count: number

      the number of results to include in the aggregation result

    Returns TopAggregator<K, V, E>

Properties

@class: string

Server-side EntryAggregator implementation type identifier.

extractor: IdentityExtractor = ...

The extractor to obtain the values to aggregate. If not explicitly set, this will default to an IdentityExtractor.

inverse: boolean = false

Result order. By default, results will be ordered in descending order.

property?: string

The property that results will be ordered by.

results: number = 0

The maximum number of results to include in the aggregation result.

Methods

  • The property name of the value to extract.

    Parameters

    • property: string

      the property name

    Returns TopAggregator<K, V, any>

  • Order the results based on the values of the specified property.

    Parameters

    • property: string

      the property name

    Returns TopAggregator<K, V, any>