Comparison

​Comparison filters are useful for comparisons and checking data types, especially for conditional logic. They will result in a true or false boolean value.

  • bitwise_not - Returns the existing value with its bits flipped.

  • equals - Returns a boolean if both values are equal.

  • even - Returns whether or not the value is even.

  • greater_than - Returns a boolean if the left value is greater than the right value.

  • greater_than_or_equal - Returns a boolean if the left value is greater than or equal to the right value.

  • in - Returns whether or not the value is in the array.

  • is_array - Returns whether or not the value is a numerical indexed array.

  • is_bool - Returns whether or not the value is a boolean.

  • is_decimal - Returns whether or not the value is a decimal value.

  • is_empty - Returns whether or not the value is empty ("", null, 0, [], {}).

  • is_int - Returns whether or not the value is an integer.

  • is_null - Returns whether or not the value is null

  • is_object - Returns whether or not the value is an object.

  • is_text - Returns whether or not the value is text.

  • less_than - Returns a boolean if the left value is less than the right value

  • less_than_or_equal - Returns a boolean if the left value is less than or equal to the right value

  • not - Returns the opposite of the existing value evaluated as a boolean

  • not_equals - Returns a boolean if both values are not equal

  • odd - Returns whether or not the value is odd

bitwise_not

Returns the existing value with its bits flipped.

equals

Returns a boolean if both values are equal.

var_2 is also 7, so in this example, the result will be true.

even

Returns whether or not the value is even, this returns a response of true or false.

In this example, we have a variable with the int 23 after applying the even filter the variable becomes false.

greater_than

Returns a boolean if the left value is greater than the right value.

The result will be true because 23 is greater than 5.

greater_than_or_equal

Returns a boolean if the left value is greater than or equal to the right value.

The result will be true because 23 is equal to 23.

in

Returns whether or not the value is in the Array, this returns a response of true or false.

var_2 is the array [1,2,7,23]. The result will be true because 23 is IN the array.

is_array

Returns whether or not the value is a numerical indexed array.

var2 is the array [1,2,7,23]. The result will be true because var_2 is an array.

is_bool

Returns whether or not the value is a boolean.

False is a boolean so the result will be true.

is_decimal

Returns whether or not the value is a decimal value.

9.86 is a decimal so the result will be true.

is_empty

Returns whether or not the value is empty ("", null, 0, [], {}).

The result will be true because the value is an empty object {}.

is_int

Returns whether or not the value is an integer.

-9 is an integer so the result will be true.

is_null

Returns whether or not the value is null, this returns a response of true or false.

In this example, we have a variable with the int 23 after applying the is_null filter the variable becomes false.

is_object

Returns whether or not the value is an object.

The result is true because the value is an object {}.

is_text

Returns whether or not the value is text.

Hello there is a text string so the result will be true.

less_than

Returns a boolean if the left value is less than the right value

The result will be true because 5 is less than 12.

less_than_or_equal

Returns a boolean if the left value is less than or equal to the right value.

5 is not less than or equal to 1 so the result will be false.

not

Returns the opposite of the existing value evaluated as a boolean.

In this example, we first have the odd filter applied to 5 which results in a true boolean. Then, the not filter is applied resulting in the opposite existing value - making the result false.

not_equals

Returns a boolean if both values are not equal.

The result will be true because 5 is not equal to 6.

odd

Returns whether or not the value is odd, this returns a response of true or false.

5 is an odd number so the result will be true.

Last updated

Was this helpful?