Skip to content

Arrays and new mode

New in 1.4

The ARRAY value type and array-aware rules are part of the new execution mode. Enable with new mode: "true" in the tool configuration block.

The new mode introduces a first-class ARRAY value type, eliminating most multi-sized-result complexity in favour of explicit array values and rules that operate on them.

Enabling new mode

tool configuration {
  new mode: "true"
}

When new mode is enabled:

  • Use(:f1, :f2, :f3)[N] collects fields into a single ARRAY value rather than forking the chain.
  • UsagiMap(...)[] returns an ARRAY of all matches.
  • LoopOver automatically expands any ARRAY field into row-level fan-out at the CDM-table boundary.

Array-aware rules

Rule Purpose
Spawn Turn an ARRAY into individual rows.
CartesianOf Cartesian product of N input arrays.
Unique Deduplicate elements across input arrays.
Without Set difference of two arrays.
Size Length of an array as INT.
RemoveItem (upcoming) Drop all elements equal to a value.
RemoveIdx (upcoming) Drop the element at a 0-based index.

RemoveItem and RemoveIdx ship with a forthcoming release that introduces additional element-wise array helpers; until that lands, the ForEach operator combined with a comparison rule covers the same use cases.

See ForEach and Blocks for the | operator, which applies a mapping rule per array element.