or
Aggregate Function
or — logical OR of input values
Synopsis
or(bool) -> bool
Description
The or aggregate function computes the logical OR over all of its input.
Examples
Ored value of simple sequence:
echo 'false true false' | zq -z 'or(this)' -
=>
true
Continuous OR of simple sequence:
echo 'false true false' | zq -z 'yield or(this)' -
=>
false
true
true
Unrecognized types are ignored and not coerced for truthiness:
echo 'false "foo" 1 true false' | zq -z 'yield or(this)' -
=>
false
false
false
true
true
OR of values grouped by key:
echo '{a:true,k:1} {a:false,k:1} {a:false,k:2} {a:false,k:2}' |
zq -z 'or(a) by k | sort' -
=>
{k:1,or:true}
{k:2,or:false}