You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for IN and NOT_IN operators that test whether a value equals any value in a provided set. This is a shorthand for multiple OR'd equality checks.
// Instead of:
find name = "Jeff" or name = "John" or name = "Jane"
// Users can write:
find name in ["Jeff", "John", "Jane"]
Motivation
When users need to match a field against several discrete values, they currently must chain multiple = conditions with or. This is verbose, error-prone, and scales poorly as the value list grows. An IN operator is a well-understood concept (SQL, most query languages) that directly expresses this intent.
Design
Operator
IN — returns true if the field value equals any value in the provided set
NOT_IN — returns true if the field value does not equal any value in the provided set
Arity
This is the first variable-arity operator. BETWEEN is fixed at 2 operands; IN accepts 1 or more. The operands() method on the operator type will need to express this (e.g., return -1 or a sentinel value to indicate variadic).
CCL Syntax
Value list syntax: square brackets with comma-separated values.
find name in ["Jeff", "John", "Jane"]
find age in [18, 21, 25]
find status not_in ["suspended", "deleted"]
Brackets were chosen because:
Unambiguous — no conflict with existing CCL parenthesized grouping
Familiar from JSON and most programming languages
Clean visual delimiter for the value list
Keyword Aliases
Operator
Aliases
IN
in, IN
NOT_IN
not_in, nin, NOT_IN, notin
No symbol alias is proposed at this time.
Implementation Plan
Add IN and NOT_IN to the operator type — include variadic arity support
Update the CCL parser/grammar — recognize [value, value, ...] as a value list token and associate it with IN/NOT_IN operators
Add keyword aliases for both operators
Write tests — parsing of IN/NOT_IN with bracket syntax, edge cases (single-element list, mixed types, empty list error)
Acceptance Criteria
CCL can parse key in [v1, v2, ..., vN] and key not_in [v1, v2, ..., vN]
All keyword aliases resolve correctly
Variable arity is supported (any number of values >= 1)
Parser rejects empty bracket list [] with a clear error
Unit tests cover single value, multiple values, mixed types, string values with commas/spaces, and negated form
Summary
Add support for
INandNOT_INoperators that test whether a value equals any value in a provided set. This is a shorthand for multiple OR'd equality checks.Motivation
When users need to match a field against several discrete values, they currently must chain multiple
=conditions withor. This is verbose, error-prone, and scales poorly as the value list grows. AnINoperator is a well-understood concept (SQL, most query languages) that directly expresses this intent.Design
Operator
IN— returnstrueif the field value equals any value in the provided setNOT_IN— returnstrueif the field value does not equal any value in the provided setArity
This is the first variable-arity operator.
BETWEENis fixed at 2 operands;INaccepts 1 or more. Theoperands()method on the operator type will need to express this (e.g., return-1or a sentinel value to indicate variadic).CCL Syntax
Value list syntax: square brackets with comma-separated values.
Brackets were chosen because:
Keyword Aliases
INin,INNOT_INnot_in,nin,NOT_IN,notinNo symbol alias is proposed at this time.
Implementation Plan
INandNOT_INto the operator type — include variadic arity support[value, value, ...]as a value list token and associate it withIN/NOT_INoperatorsIN/NOT_INwith bracket syntax, edge cases (single-element list, mixed types, empty list error)Acceptance Criteria
key in [v1, v2, ..., vN]andkey not_in [v1, v2, ..., vN][]with a clear error