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

Examples

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

Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19