List of Blogger Membership Operators
Operator | Meaning | Default syntax |
---|---|---|
in |
Found in | Operand in [ARRAY] |
Operand in ( EXPRESSION ) | ||
contains |
Include | [ARRAY] contains Operand |
EXPRESSION contains operand | ||
Functional Syntax | Operand operator ( Operand,Operand ) |
|
Operand operator ( Operand operator Operand ) |
||
Operand operator ( Operand operator ( Operand operator Operand )) |
- Member operators always return a Boolean value.
- The Operand to be compared must be of the same type as the array, either String, Boolean or Number.
- The Operand to compare can be: An Blogger value, a dataset or the result of a Blogger Expression.
- The operation can be nested in another operation that accepts operand type of boolean.
- When ARRAY is a dataset of String, each must be wrapped with Double Quote: "STRING" and separeated by comma: "STRING","STRING".
Blogger Membership Operator Examples
Operator "[IN]"
<b:eval expr='"Foo" in ["Foo","Bar","Baz"]'/>
Operator "[CONTAINS]"
<b:eval expr='["Foo","Bar","Baz"] contains "Foo"'/>
Operator "[CONTAINS]" with "[EXPRESSION]"
<b:if cond='data:post.body contains "Foo"'> <!-- item --> </b:if>
Nesting in a logical operation
<b:eval expr='data:posts.size in [7,20,50] and data:view.isMultipleItems'/>
Nesting in a Lambda operation
<b:eval expr='data:posts count (p => p.labels any (l => l.name contains "Foo"))'/>
Nesting in a ternary operation
<b:eval expr='data:view.search.label in ["Foo","Bar"] ? "Welcome to Label Foo" : "Welcome to Label Bar"'/>