Introduction to filter expressions
Filter expressions are integrated into various parts of the BizzStream platform to provide granular control over data visibility and relationships. Here's a detailed look at where you'll encounter them and how to apply them.
Filter Expressions
Filter expressions are SQL-like conditions that are used to filter documents. In filter expressions, you can incorporate text expressions by enclosing them in double curly braces ({{ }}
). For example, the following filter expression selects documents where the "price"
field is greater than 0
and less than a value set in the "maximumValue"
field.
price > 0 AND price < {{F["maximumValue"]}}
Where Are Filter Expressions Used?
They will be all explained further in their own individual documentation. A quick preview of what each expression is used for is described here:
Location | Purpose | Description |
---|---|---|
Document definitions | Reference Filter | Defines filters for reference fields. |
Layouts | Dataset Filter | Applies a filter to a dataset. |
Menus | Menu Block Filter | This is a crucial point in the dataset filters in these menu blocks. Can filter a document out of a whole dataset. |
Filter Comparison Operators
Operator | Description | Usage/Example |
---|---|---|
= or IS |
Checks if values are equal. | {{F['price']}} IS 5 |
<> or != or IS NOT |
Checks if values are not equal. | {{F['price']}} IS NOT 5 |
> |
Checks if a value is greater than another. | {{F['price']}} > 5 |
< |
Checks if a value is less than another. | {{F['price']}} < 5 |
>= |
Checks if a value is greater than or equal to another. | {{F['price']}} >= 5 |
<= |
Checks if a value is less than or equal to another. | {{F['price']}} <= 5 |
BETWEEN |
Checks if a value falls within a given range. | {{F['price']}} BETWEEN 1 AND 10 |
IN |
Checks if a value exists within a list. | {{F['price']}} IN [5, 4, 3] |
NOT IN |
Checks if a value does not exist within a list. | {{F['price']}} NOT IN [4, 3] |
CONTAINS |
Checks if a field contains a specific substring. | CONTAINS({{F['name']}}, 'Duit 8') |
NOT CONTAINS |
Checks if a field does not contain a specific substring. | NOT CONTAINS({{F['name']}}, 'Duit 8') |
These operators can also be used in combination with BizzStream Expressions. The linked documentation offers essential insight into filter usage and the flexibility they support.
Chaining Operators
Operator | Description |
---|---|
AND |
Returns documents where all specified conditions are TRUE . |
OR |
Returns documents where at least one condition is TRUE . |
These operators allow you to chain filter comparison operators. For example:
number >= 5 AND number IS NOT 10
Getting started
To start using these filters, begin by reading about the different types listed in the table above. After that, you can explore the various expression filters.