Skip to content

List Operators

Matches a field against a set of candidate values.

OperatorSQLMeaning
inINValue is one of the array
inqINAlias for in
ninNOT INValue 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 (not IS NULL) and matches no rows; use is/eq for 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 or branch: { 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 (not IS NOT NULL) and matches no rows.

See also

Files: