Boolean Functions

Boolean Functions

Boolean functions

$boolean()

Signature: $boolean(arg)

Casts the argument to a Boolean using the following rules:

| Argument type | Result |

| ------------- | ------ |

| Boolean | unchanged |

| string: empty | false|

| string: non-empty | true |

| number: 0 | false|

| number: non-zero | true |

| null | false|

| array: empty | false |

| array: contains a member that casts to true | true |

| array: all members cast to false | false |

| object: empty | false |

| object: non-empty | true |

| function | false |

$not()

Signature: $not(arg)

Returns Boolean NOT on the argument. arg is first cast to a boolean

$exists()

Signature: $exists(arg)

Returns Boolean true if the arg expression evaluates to a value, or false if the expression does not match anything (e.g. a path to a non-existent field reference).


    • Related Articles

    • Boolean Operators

      Boolean Operators and (Boolean AND) The 'and' operator returns Boolean true if both operands evaluate to true. If either or both operands is not a Boolean type, then they are first cast to a Boolean using the rules of the $boolean function. Example ...
    • Numeric Functions

      Numeric functions $number() Signature: $number(arg) Casts the arg parameter to a number using the following casting rules - Numbers are unchanged - Strings that contain a sequence of characters that represent a legal JSON number are converted to that ...
    • Object Functions

      Object functions Fuuz Context Where this applies in Fuuz: Object utilities help normalize heterogeneous payloads from connectors, merge partial updates, and emit well-formed objects to Fuuz topics. $keys/$lookup: Discover and retrieve fields across ...
    • Array Functions

      Array Functions (Combined) $count() Signature: $count(array) Returns the number of items in the array parameter. If the array parameter is not an array, but rather a value of another JSON type, then the parameter is treated as a singleton array ...
    • Higher Order Functions

      Higher order functions $map() Signature: $map(array, function) If the input argument is an array of 2 or more elements, returns an array containing the results of applying the function parameter to each value in the array parameter. $map([1,2,3], ...