List Operators
Matches a field against a set of candidate values.
| Operator | SQL | Meaning |
|---|---|---|
in | IN | Value is one of the array |
inq | IN | Alias for in |
nin | NOT IN | Value is none of the array |
in / inq
typescript
{ where: { status: { in: ['active', 'pending', 'review'] } } }
// SQL: WHERE "status" IN ('active', 'pending', 'review')Notice: in and inq are the same operator under two names.
Edge cases:
{ in: [] }(empty array) matches no rows (WHERE false).{ in: 'value' }(non-array operand) falls back to=.{ in: null }falls back to= NULL(notIS NULL) and matches no rows; useis/eqfor null checks.
nin
typescript
{ where: { status: { nin: ['deleted', 'archived', 'banned'] } } }
// SQL: WHERE "status" NOT IN ('deleted', 'archived', 'banned')Notice: NOT IN excludes rows where the column is NULL.
Edge cases:
- Include NULL rows with an explicit
orbranch:{ or: [{ status: { nin: [...] } }, { status: { is: null } }] }. { nin: [] }(empty array) matches all rows (WHERE true).{ nin: 'value' }(non-array operand) falls back to!=.{ nin: null }falls back to!= NULL(notIS NOT NULL) and matches no rows.
See also
- Filter System Overview - the
filtershape and the fullwhereoperator table - Array Operators -
contains/containedBy/overlapsmatch against array COLUMNS, not to be confused within/nin - Quick Reference - every operator, one line each
Files:
packages/connectors/src/relational/postgres/repositories/dialect/query.ts-PostgresQueryOperators.FNS, per-operator SQL builderspackages/connectors/src/relational/core/repositories/dialect/filter.ts-FilterBuilder, translatesTFilterto Drizzle/SQLpackages/filter/src/common/operators.ts-QueryOperatorsconstants