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
| Parameter | Type | Required | Description |
|---|---|---|---|
array | ARRAY<BOOLEAN> | Yes | Array 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 ARRAY | f2 ARRAY | f3 ARRAY | f4 ARRAY |
|---|---|---|---|
| [false, true, false] | [true, true, true] | [false, false, false] | [] |
On this page