Filter expressions
Filter expressions can be used by various parts of Boundary to provide useful functionality. This page describes the overall syntax; see the sub-pages for information on the specific values available for filtering for various features, including examples.
Each filter expression has matching operators composed with selectors and values.
Create expressions
A single expression is a matching operator with a selector and value. They are written in plain text format, and Boolean logic and parenthesization are supported. In general whitespace is ignored, except within literal strings.
Matching operators
All matching operators use a selector or value to choose what data should be matched. Each endpoint that supports filtering accepts a potentially different list of selectors and is detailed in the API documentation for those endpoints.
Selectors
Selectors are used by matching operators to create an expression. Inputs to
filter expressions are JSON (or JSON-derived); selectors therefore use JSON
Pointer to select values from the input.
Each selector must be enclosed in quotes and contain a valid JSON Pointer path,
including leading slash (/
).
Values
Values are used by matching operators to create an expression. Values can be any valid selector, a number, or a string. It is best practice to quote values.
Numbers can be base 10 integers or floating point numbers.
When quoting strings, they may either be enclosed in double quotes or backticks.
When enclosed in backticks they are treated as raw strings and escape sequences
such as \n
will not be expanded.
Connect expressions
There are several methods for connecting expressions, including
- Logical
or
- Logical
and
- Logical
not
- Grouping with parenthesis
- Matching expressions
Standard operator precedence can be expected for the various forms. For example, the following two expressions would be equivalent.
Performance
Filters are executed on the controllers and therefore will consume some amount of CPU time on the controller.