JS-like spread syntax for arrays and objects in AQL

Spread syntax turns an expression of type array or object into a sequence of values:

  • ...[1, 2, 3] yields the three values of the array
  • ...{ one: 1 two: 2 } yields the two arrays ['one', 1] and ['two', 2]

These sequences can be used wherever multiple values would normally be given:

  • in the construction of an array
  • in the construction of an object (dynamically rejecting all values that are not pairs)
  • when emitting multiple events from a SELECT clause (currently an internal alpha feature)

This feature combines with sub-queries to allow dynamic “flatMap” semantics for SELECT:

FROM 'my-tag'
    ...FROM 'other-tag' SELECT _.whatever END

This will perform the sub-query for each input and concatenate the sub-query result streams into the overall output stream.