List-type attributes
List attributes represent multi-value attributes. The values in the list have a type.
The arguments the operator admits will depend on the type of the values within the list. An example is customer_tags
, which is a multi-value list of strings. Its full type is therefore List<string>
.
Lists support the following operators and conditions.
Operators | Description | Example |
---|---|---|
CONTAINS |
Allows you to specify a single value in a WHERE clause. The clause is true if the value matches an entry in the preceding list attribute. |
customer_tags CONTAINS 'vip' products_purchased() CONTAINS 2012162031638 |
NOT CONTAINS |
True complement of CONTAINS . The clause is true if the value does not match an entry in the preceding list attribute. |
customer_tags NOT CONTAINS 'vip' products_purchased() NOT CONTAINS 2012162031638 |
The semantics of
CONTAINS
as applied to aLIST
is that the arguments must be a subset of the preceding list attribute.Segmentation queries currently use multiple clauses with connectors to specify multiple values, rather than a multi-argument form.
List<String>
conditions
Anchor link to section titled "ListString
conditions accept UTF-8 characters and must be wrapped with single quotes'
, similar to theENUM
type in MySQL.Conditions are NOT case-sensitive and whitespaces are syntactically significant.
Single quotes within a condition must be escaped (ie.
'\'VIP\''
).
List<ID>
conditions
Anchor link to section titled "ListID is an alias for an unsigned integer. The underlying data type is a
uint64
.Conditions don't have to be wrapped in single quotes
'
.