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