API reference
Table of contents

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/Type Description
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