Collect Transform

The collect transform collects all the objects in a data stream within a single array, allowing sorting by data field values.

Transform Parameters

Property Type Description
sort Compare A comparator definition for sorting data objects.

Usage

To sort data objects by the value field in descending order:

{
  "type": "collect",
  "sort": {
    "field": "value",
    "order": "descending"
  }
}

To sort data objects according to multiple criteria:

{
  "type": "collect",
  "sort": {
    "field": ["a", "b"],
    "order": ["ascending", "descending"]
  }
}