ARRAY_ENUMERATE()

All functions > ARRAY > ARRAY_ENUMERATE()

Returns an array of rows pairing each 1-based position with the corresponding element.

Signatures

Returns: Array of index/value rows

ARRAY_ENUMERATE(array: ARRAY<T>) → ARRAY<ROW(index BIGINT, value T)>
sql
ParameterTypeRequiredDescription
arrayARRAY<T>YesInput array

Notes

  • Index positions start at 1 for the first element
  • Preserves element order from the input array
  • Output rows use field names index and value

See also

Examples

FeatureQL
SELECT
    f1 := ARRAY_ENUMERATE(ARRAY[10, 20, 30]) -- Pairs index with value
;
Result
f1 VARCHAR
[{index: 1, value: 10}, {index: 2, value: 20}, {index: 3, value: 30}]

Last update at: 2026/05/26 17:22:09