|purpose||filter the input by comparing each item against the operand|
|input||a selection of titles|
|parameter||the value to compare|
|output||those input titles matching the specified comparison|
|those input titles not matching the specified comparison|
New in: 5.1.22The
compare filter allows numerical, string and date comparisons to be performed.
compare operator uses an extended syntax to specify all the options:
The type can be:
- "number" - invalid numbers are interpreted as zero
- "integer" - invalid integers are interpreted as zero
- "date" - invalid dates are interpreted as 1st January 1970
- "version" - invalid versions are interpreted as "v0.0.0"
The mode can be:
- "eq" - equal to
- "ne" - not equal to
- "gteq" - greater than or equal to
- "gt" - greater than
- "lteq" - less than or equal to
- "lt" - less than
The operator compares each item in the selection against the value of the parameter, retaining only those items that pass the specified condition.
[compare:number:eq] returns nothing [compare:number:lt] returns "2" [compare:number:eq] returns "2"
Note that several of the variants of the
compare operator are synonyms for existing operators, and are provided in the interests of consistency. For example,
compare:string:eq[x] is a synonym for