Filters
Filters allow you to only show specific data inside of a list subscription. For example, only showing specific conversations you are in.
Passed to Session.subscribeConversations, specifying which conversations should be returned in the subscription.
Either a SimpleConversationFilter or a CompoundFilter OR-ing multiple simple filters together.
1{ subject: ["==", "cats!"] }
Allows you to filter conversations in a subscription, only showing those that match this filter.
Multiple conversation filters can be OR-ed together using CompoundFilter.
Only select conversations that the current user as specific access to.
Must be an 2-element array of [operator, operand] structure. Valid operators are: "==", "!=", "oneOf", and "!oneOf".
The operand must be either a string (one of "ReadWrite" or "Read") or an array of strings (for the oneOf operators).
Only select conversations that have been created in a particular time interval.
Must be an 2-element array of [operator, operand] structure. Valid operators are: ">", "<", ">=", "<=", "between", and "!between".
The operand must be either a number or a 2-element array of numbers (for the between operators).
Only select conversations that have particular custom fields set to particular values.
Every key must correspond to a key in the custom conversation data that you set (by passing custom to ConversationBuilder​.setAttributes). It is not necessary for all conversations to have these keys.
Each value must be one of the following:
A string, equal to "exists" or "!exists"
A 2-element array of [operator, operand] structure. The operand must be either a string or an array of strings (for the oneOf operators). Valid operators are: "==", "!=", "oneOf", and "!oneOf".
1{ custom: { category: ["==", "shoes"] } }
1{2 custom: {3 topic: ["oneOf", ["inquiry", "reservation"]]4 }5}
Only select conversations that have, or do not have messages.
Set this field to only select conversations that have, or don't have any, unread messages.
Only select conversations that the current user joined in a particular time interval.
Must be an 2-element array of [operator, operand] structure. Valid operators are: ">", "<", ">=", "<=", "between", and "!between".
The operand must be either a number or a 2-element array of numbers (for the between operators).
Only select conversations that have the last message sent in a particular time interval.
If the conversation has no messages, this falls back to using joinedAt instead. This matches the default sort order for conversations in a conversation list.
Must be an 2-element array of [operator, operand] structure. Valid operators are: ">", "<", ">=", "<=", "between", and "!between".
The operand must be either a number or a 2-element array of numbers (for the between operators).
Only select conversations that have the subject set to particular values.
Must be an 2-element array of [operator, operand] structure. Valid operators are: "==", "!=", "oneOf", and "!oneOf".
The operand must be either a string or an array of strings (for the oneOf operators).
A two-element array that forms a predicate about a field.
Used in MessagePredicate and ConversationPredicate. Possible forms:
- ["==", "someValue"]
- ["!=", "someValue"]
- ["oneOf", ["someValue", "someOtherValue"]]
- ["!oneOf", ["someValue", "someOtherValue"]]
A two-element array that forms a predicate about a numeric field.
Used in ConversationPredicate. Possible forms:
- [">", someNumber]
- ["<", someNumber]
- [">=", someNumber]
- ["<=", someNumber]
- ["between", [lowerBound, upperBound]]
- ["!between", [lowerBound, upperBound]]
The lower bound is inclusive, the upper bound is exclusive.
A string or a two-element array that forms a predicate about a string field in a custom field.
Used in MessagePredicate and ConversationPredicate. Allows all forms in StringFilter plus the following:
- "exists"
- "!exists"
Combines multiple simple filters into one, matching whenever any of the simple filters match (OR).
The first element must be the string "any", and the second element a list of simple filter objects.
See SimpleConversationFilter for all available options in simple conversation filters.