Simple Aggregator DSL.

Remarks

The methods in this class are for the most part simple factory methods for various EntryAggregator classes, but in some cases provide additional type safety. They also tend to make the code more readable, especially if imported statically, so their use is strongly encouraged in lieu of direct construction of EntryAggregator classes.

Hierarchy

  • Aggregators

Constructors

Methods

  • Return an aggregator that calculates a average of the numeric values extracted from a set of entries in a Map.

    Returns

    an aggregator that calculates a average of the numeric values extracted from a set of entries in a Map

    Type Parameters

    • K = any

      the type of the entry's key

    • V = any

      the type of the entry's value

    Parameters

    • extractorOrProperty: string | ValueExtractor

      the extractor or method/property name to provide values for aggregation

    Returns EntryAggregator<K, V, number>

  • Return an aggregator that calculates a number of values in an entry set.

    Returns

    an aggregator that calculates a number of values in an entry set

    Type Parameters

    • K = any

      the type of the entry's key

    • V = any

      the type of the entry's value

    Returns EntryAggregator<K, V, number>

  • Return an aggregator that calculates the set of distinct values from the entries in a Map.

    Returns

    an aggregator that calculates the set of distinct values from the entries in a Map

    Type Parameters

    • K = any

    • V = any

    Parameters

    • extractorOrProperty: string | ValueExtractor

      the extractor or method/property name to provide values for aggregation

    Returns EntryAggregator<K, V, number>

  • Return a GroupAggregator based on a specified property or method name(s) and an EntryAggregator.

    Returns

    a new GroupAggregator

    Type Parameters

    • K = any

      the type of the Map entry keys

    • V = any

      the type of the Map entry values

    • T = any

      the type of the value to extract from

    • E = any

      the type of the extracted value

    • R = any

      the type of the group aggregator result

    Parameters

    • extractorOrProperty: string | ValueExtractor

      the extractor or method/property name to provide values for aggregation

    • agg: EntryAggregator<K, V, T>

      an underlying EntryAggregator

    • filter: Filter

      an optional Filter object used to filter out results of individual group aggregation results

    Returns EntryAggregator<K, V, Map<E, R>>

  • Return an aggregator that calculates a maximum of the numeric values extracted from a set of entries in a Map.

    Returns

    an aggregator that calculates a maximum of the numeric values extracted from a set of entries in a Map

    Parameters

    • extractorOrProperty: string | ValueExtractor

      the extractor or method/property name to provide values for aggregation

    Returns MaxAggregator

  • Return an aggregator that calculates a minimum of the numeric values extracted from a set of entries in a Map.

    Returns

    an aggregator that calculates a minimum of the numeric values extracted from a set of entries in a Map

    Type Parameters

    • K = any

      the type of the entry's key

    • V = any

      the type of the entry's value

    Parameters

    • extractorOrProperty: string | ValueExtractor

      the extractor or method/property name to provide values for aggregation

    Returns EntryAggregator<K, V, number>

  • Return a new PriorityAggregator to control scheduling priority of an aggregation operation.

    Type Parameters

    • K = any

      the type of the Map entry keys

    • V = any

      the type of the Map entry values

    • R = any

      the type of the final result

    Parameters

    • agg: EntryAggregator<K, V, R>

      the underlying EntryAggregator

    • schedulingPriority: Schedule = aggregator.Schedule.STANDARD

      the schedule priority

    • executionTimeout: number = aggregator.Timeout.DEFAULT

      the execution timeout

    • requestTimeout: number = aggregator.Timeout.DEFAULT

      the request timeout

    Returns PriorityAggregator<K, V, R>

  • Returns a new QueryRecorder aggregator which may be used is used to produce an object that contains an estimated or actual cost of the query execution for a given Filter.

    Returns

    a new QueryRecorder aggregator which may be used is used to produce an object that contains an estimated or actual cost of the query execution for a given Filter

    Type Parameters

    • K = any

      the type of the Map entry keys

    • V = any

      the type of the Map entry values

    Parameters

    Returns QueryRecorder<K, V>

  • Return an aggregator that will return the extracted value for each entry in the map.

    Type Parameters

    • K = any

      the type of the Map entry keys

    • V = any

      the type of the Map entry values

    • E = any

      extracted value type

    • R = any

      the type of the group aggregator result

    Parameters

    • extractorOrProperty: string | ValueExtractor

      the extractor or method/property name to provide values for aggregation

    Returns ReducerAggregator<K, V, Map<K, E>>

  • Return an aggregator that is implemented in a script using the specified language.

    Returns

    an aggregator that is implemented in a script using the specified language

    Type Parameters

    • K = any

      the type of the Map entry keys

    • V = any

      the type of the Map entry values

    • R = any

      the type of the group aggregator result

    Parameters

    • language: string

      the string specifying one of the supported languages

    • name: string

      the aggregator name

    • args: any[]

      arguments to pass to the aggregator

    Returns ScriptAggregator<K, V, R>

  • Return an aggregator that calculates a sum of the numeric values extracted from a set of entries in a Map.

    Returns

    an aggregator that calculates a sum of the numeric values extracted from a set of entries in a Map

    Parameters

    • extractorOrProperty: string | ValueExtractor

      the extractor or method/property name to provide values for aggregation

    Returns SumAggregator

  • Return an aggregator that aggregates the top N extracted values into an array.

    Type Parameters

    • K

    • V

    • R

    Parameters

    • count: number

      the maximum number of results to include in the aggregation result

    Returns TopAggregator<K, V, R>