ARRAY_NOT()

All functions > ARRAY > ARRAY_NOT()

Returns an array with inverted boolean values (logical NOT applied to each element).

Signatures

Returns: Array with each element inverted

ARRAY_NOT(array: ARRAY<BOOLEAN>) → ARRAY<BOOLEAN>
sql
ParameterTypeRequiredDescription
arrayARRAY<BOOLEAN>YesArray of boolean values to invert

Notes

  • Applies logical NOT to each element
  • true becomes false, false becomes true
  • Preserves array structure and order
  • NULL values remain NULL

See also

Examples

FeatureQL
SELECT
    -- Invert boolean values
    f1 := ARRAY_NOT(ARRAY(TRUE, FALSE, TRUE)),
    -- All false becomes all true
    f2 := ARRAY_NOT(ARRAY(FALSE, FALSE, FALSE)),
    -- All true becomes all false
    f3 := ARRAY_NOT(ARRAY(TRUE, TRUE, TRUE)),
    -- Empty array
    f4 := ARRAY_NOT(ARRAY()::BOOLEAN[])
;
Result
f1 ARRAYf2 ARRAYf3 ARRAYf4 ARRAY
[false, true, false][true, true, true][false, false, false][]

Last update at: 2026/06/20 10:08:10