Overview
Description
This category provides a set of extensions for WHERE conditions on SelectQueryBuilder, UpdateQueryBuilder, DeleteQueryBuilder and SoftDeleteQueryBuilder (softDelete(), restore()): IN, = ANY(...), PostgreSQL array and JSON operators, null-safe comparisons, period filters and [NOT] EXISTS subqueries.
Methods
- whereIsIn: add
IN/NOT INconditions by column name. - whereIsAny: add
= ANY(array)conditions by column name, with the array bound as one parameter (PostgreSQL). - innerJoinUnnest: keep the rows whose column is in an array by joining
unnest(array), an alternative plan to= ANYfor large arrays (PostgreSQL). - whereArrayContains / ContainedBy / Overlaps: add
@>,<@,&&conditions on array columns (PostgreSQL). - whereJsonContains / whereJsonHasKey: add
@>and?conditions on JSON columns (PostgreSQL). - whereIsDistinctFrom: add null-safe
IS [NOT] DISTINCT FROMconditions (any database). - applyPeriodFilter: filter by a period
{ periodFrom, periodTo }of a date / time column (any database). - whereNotExists / whereExists: add
NOT EXISTS (subquery)conditions, andEXISTSon update and delete queries, which TypeORM lacks (any database).
For typesafe versions that take the column from an entity property, see whereIsInTyped, whereIsAnyTyped, whereArrayContainsTyped, whereJsonContainsTyped, whereIsDistinctFromTyped and applyPeriodFilterTyped.