filter
parameter allows for scoping down queries. It consists of nodes which are used to build tree-like structure and generate correct SQL queries over underlying databases."type"
key which determines logic that needs to be applied.{
"type" => "and",
"operations" => [
{ "type" => "equal", "field" => "grouping_type", "value" => "optin_channel" },
{ "type" => "equal", "field" => "grouping_value", "value" => "default" }
]
}
filter
parameter to a query will scope it down to records/timeseries data which have both:grouping_type
field with optin_channel
value andgrouping_value
field with default
value"type"
- logical node type (see below)"operations"
- array with underlying nodes"type" key | Operation logic | Rate limiting cost |
---|---|---|
and | Joins operations with AND | 1 |
or | Joins operations with OR | 3 |
"type"
- operation node type (see below)"field"
- field which will be used for operation. Note that this field must be "filterable" for given report."value"
- value which will be used in operation"type" key | Operation logic | Requirements | Additional notes |
---|---|---|---|
equal | Checks whether field equals to value | - | When null is provided as a value then IS NULL query will be executed |
not_equal | Checks whether field is not equal to value | - | When null is provided as a value then IS NOT NULL query will be executed |
greater_than | Checks whether field is greater than value | Field must be numerical or timestamp. | - |
greater_or_equal_to | Checks whether field is greater or equal to value | Field must be numerical or timestamp. | - |
less_than | Checks whether field is less than value | Field must be numerical or timestamp. | - |
less_or_equal_to | Checks whether field is less or equal to value | Field must be numerical or timestamp. | - |
in | Checks whether field equals to one of provided values | Value must be an array | When field is an array, then it will be returned when any elements are in common |
not_in | Checks whether field not equals to one of provided values | Value must be an array | Logical opposite of in |
1
token to request cost."type"
- JSON operation node type (see below)"field"
- field which will be used for operation. It needs to be formatted as <report field>.<json_key>
(for example consents.sms_consent
). Note that <report's field>
must be filterable."value"
- value which will be used in operation"type" key | Operation logic | Requirements | Additional notes |
---|---|---|---|
exists | Checks whether JSON key exists | - | - |
not_exists | Checks whether JSON key does not exist | - | - |
equal | Checks whether JSON key value is equal to value | - | - |
not_equal | Checks whether JSON key value is not equal to value | - | - |
2
tokens to request cost.{
"type": "and",
"operations": [
{ "type": "equal", "field": "grouping_type", "value": "optin_channel" },
{ "type": "equal", "field": "grouping_value", "value": "default" }
]
}
and
logical node) + 2x1 (equal
operation nodes) = 3
tokens of rate limit cost.