This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Dan Gorman edited this page Nov 29, 2018
·
4 revisions
OR
returns true if any provided arguments return logical true, otherwise it returns false. Everything except FALSE is treated as true.
OR(arg1, [arg2...])
-
arg1
is an expression that can be interpreted as true or false (including numbers, strings, and arrays etc.) -
arg2
is optional, and has the same restrictions asarg1
-
OR
can take an arbitrary number of additional arguments as well
Let's say we're given a response with some fleet deployment information that looks like this, with the api returning no data for the fleet_3
element:
{
"data":{
"fleet_ready":{
"fleet_1":true,
"fleet_2":false,
"fleet_3":null
}
}
}
If we want to determine whether any fleets are ready to deploy, we can use OR
:
OR(data.fleet_ready.fleet_1, data.fleet_ready.fleet_2, data.fleet_ready.fleet_3)
This would return true
.
OR(data.fleet_ready.fleet_1, data.fleet_ready.fleet_2) => true
OR(data.fleet_ready.fleet_1, data.fleet_ready.fleet_3) => true
OR(data.fleet_ready.fleet_2, data.fleet_ready.fleet_3) => false