The internal expression engine is Expr. You can find exhaustive documentation on the possibilities of the language at this address.
- strings - single and double quotes (e.g.
"hello"
,'hello'
) - numbers - e.g.
103
,2.5
- arrays - e.g.
[1, 2, 3]
- maps - e.g.
{foo: "bar"}
- booleans -
true
andfalse
- nil -
nil
Article properties can be accessed by using their name:
Title
: Article titleText
: Article text descriptionContent
: Article HTML contentLink
: Article URLMeta["key"]
: Metadata valueTags
: Array of tags
==
(equal)!=
(not equal)<
(less than)>
(greater than)<=
(less than or equal to)>=
(greater than or equal to)
not
or!
and
or&&
or
or||
+
(concatenation)matches
(regex match)contains
(string contains)startsWith
(has prefix)endsWith
(has suffix)toLower
(to lower case)toUpper
(to upper case)
To test if a string does not match a regex, use the logical not
operator in combination with the matches
operator:
not (Title matches "^b.+")
You must use parenthesis because the unary operator not
has precedence over the binary operator matches
.
Example:
'Arthur' + ' ' + 'Dent'
Result will be set to Arthur Dent
.
in
(contain)not in
(does not contain)
Example:
"test" in Tags
meta.author in ['me', 'other']
len
(length of array or string)all
(will returntrue
if all element satisfies the predicate)none
(will returntrue
if all element does NOT satisfies the predicate)any
(will returntrue
if any element satisfies the predicate)one
(will returntrue
if exactly ONE element satisfies the predicate)filter
(filter array by the predicate)map
(map all items with the closure)
Example:
len(Text) > 200
{...}
(closure)
Closures allowed only with builtin functions. To access current item use #
symbol.
one(tags, {# == 'test'})