Need a special offer?Find out if your project fits.
+
All documentation
  • API Reference for older versions
  • AggregationsObject

    This object allows specifying available aggregation functions for all fields of a certain type.

    Properties

    aggregations: {
      date: string[],
      number: string[],
      string: string[],
      time: string[]
    }
    Property/TypeDescription
    date
    String[]
    optional Available aggregation functions for the "date string" field type.
    number
    String[]
    optional Available aggregation functions for the "number" field type.
    string
    String[]
    optional Available aggregation functions for the "string" field type.
    time
    String[]
    optional Available aggregation functions for the "time" field type.

    Example

    Here is an example of defining available aggregations for fields of a certain type:

    dataSource: {
      filename: "data.json",
      mapping: {
        aggregations: {  
          number: [ "sum", "average" ],
          date: [ "max", "min" ],
          string: [ "count", "distinctcount" ]
        },
        // Other mapping configs
      }
    }

    Check out this example on JSFiddle.

    See also

    Mapping guide
    MappingObject
    FieldMappingObject