flatMap
Map each element to an array, then flatten one level. Equivalent to flatten(map(...)). Use when each element produces multiple results.
array(required): the array to processfn(required): lambda(element) -> array
bash
echo '{"orders": [{"lines": [1,2]}, {"lines": [3]}]}' \
| utlx -e 'flatMap(.orders, (o) -> o.lines)'
# [1, 2, 3]utlx
{
allLines: flatMap($input.orders, (o) -> o.lines)
}