Skip to content

postgrelize / Op

Variable: Op ​

const Op: object

Defined in: src/expressions/op.ts:71

Query operators for where clauses.

Symbols are created with Symbol.for(name) exactly like Sequelize v6, so operators imported from sequelize and from postgrelize are interchangeable. Operators marked "PostgreSQL extension" do not exist in Sequelize v6.

Type Declaration ​

adjacent ​

adjacent: typeof adjacent

-|- — ranges are adjacent.

all ​

all: typeof all

ALL (ARRAY[...]), combined with a comparison operator.

and ​

and: typeof and

Logical AND of nested conditions.

any ​

any: typeof any

ANY (ARRAY[...]), combined with a comparison operator.

between ​

between: typeof between

BETWEEN a AND b, value is [a, b].

col ​

col: typeof col

Compares with another column, value is a column reference such as 'user.id'.

contained ​

contained: typeof contained

<@ — array, range or jsonb is contained by the value.

containedOrEqual ​

containedOrEqual: typeof containedOrEqual

<<= — inet/cidr subnet is contained within or equals the value. PostgreSQL extension.

contains ​

contains: typeof contains

@> — array, range or jsonb contains the value.

containsOrEqual ​

containsOrEqual: typeof containsOrEqual

>>= — inet/cidr subnet contains or equals the value. PostgreSQL extension.

endsWith ​

endsWith: typeof endsWith

LIKE '%value'.

eq ​

eq: typeof eq

= value; IS NULL when the value is null.

gt ​

gt: typeof gt

> value.

gte ​

gte: typeof gte

>= value.

hasAllKeys ​

hasAllKeys: typeof hasAllKeys

jsonb ?& — all of the keys exist. PostgreSQL extension.

hasAnyKeys ​

hasAnyKeys: typeof hasAnyKeys

jsonb ?| — any of the keys exist. PostgreSQL extension.

hasKey ​

hasKey: typeof hasKey

jsonb ? — top-level key exists. PostgreSQL extension.

iLike ​

iLike: typeof iLike

ILIKE pattern.

in ​

readonly in: typeof inOp = inOp

IN (...); long lists compile to = ANY($n).

iRegexp ​

iRegexp: typeof iRegexp

~* pattern (case-insensitive regular expression).

is ​

is: typeof is

IS value, for null, true or false.

isDistinctFrom ​

isDistinctFrom: typeof isDistinctFrom

IS DISTINCT FROM value (null-safe <>). PostgreSQL extension.

isNotDistinctFrom ​

isNotDistinctFrom: typeof isNotDistinctFrom

IS NOT DISTINCT FROM value (null-safe =). PostgreSQL extension.

join ​

join: typeof join

Reserved by Sequelize v6 for internal use.

jsonPathExists ​

jsonPathExists: typeof jsonPathExists

jsonb @? — the jsonpath returns any item; the value is a jsonpath string. PostgreSQL extension.

like ​

like: typeof like

LIKE pattern.

lt ​

lt: typeof lt

< value.

lte ​

lte: typeof lte

<= value.

match ​

match: typeof match

@@ — tsvector matches tsquery.

ne ​

ne: typeof ne

<> value; IS NOT NULL when the value is null.

noExtendLeft ​

noExtendLeft: typeof noExtendLeft

&> — range does not extend to the left of the value.

noExtendRight ​

noExtendRight: typeof noExtendRight

&< — range does not extend to the right of the value.

not ​

not: typeof not

IS NOT value for null/booleans, otherwise negates a nested condition.

notBetween ​

notBetween: typeof notBetween

NOT BETWEEN a AND b, value is [a, b].

notILike ​

notILike: typeof notILike

NOT ILIKE pattern.

notIn ​

notIn: typeof notIn

NOT IN (...); long lists compile to <> ALL($n).

notIRegexp ​

notIRegexp: typeof notIRegexp

!~* pattern.

notLike ​

notLike: typeof notLike

NOT LIKE pattern.

notRegexp ​

notRegexp: typeof notRegexp

!~ pattern.

notSimilarTo ​

notSimilarTo: typeof notSimilarTo

NOT SIMILAR TO pattern. PostgreSQL extension.

or ​

or: typeof or

Logical OR of nested conditions.

overlap ​

overlap: typeof overlap

&& — arrays or ranges overlap.

placeholder ​

placeholder: typeof placeholder

Reserved by Sequelize v6 for internal use.

regexp ​

regexp: typeof regexp

~ pattern (POSIX regular expression).

similarTo ​

similarTo: typeof similarTo

SIMILAR TO pattern (SQL regular expression). PostgreSQL extension.

startsWith ​

startsWith: typeof startsWith

LIKE 'value%'.

strictLeft ​

strictLeft: typeof strictLeft

<< — range is strictly left of the value.

strictRight ​

strictRight: typeof strictRight

>> — range is strictly right of the value.

substring ​

substring: typeof substring

LIKE '%value%'.

trigramHasSimilarStrictWord ​

trigramHasSimilarStrictWord: typeof trigramHasSimilarStrictWord

%>> — pg_trgm: the column has a strictly similar word of the value. PostgreSQL extension.

trigramHasSimilarWord ​

trigramHasSimilarWord: typeof trigramHasSimilarWord

%> — pg_trgm: the column has a part similar to the value (commutator of <%). PostgreSQL extension.

trigramSimilar ​

trigramSimilar: typeof trigramSimilar

% — pg_trgm trigram similarity above pg_trgm.similarity_threshold. PostgreSQL extension.

trigramStrictWordSimilar ​

trigramStrictWordSimilar: typeof trigramStrictWordSimilar

<<% — pg_trgm: the column is strictly similar to a word of the value. PostgreSQL extension.

trigramWordSimilar ​

trigramWordSimilar: typeof trigramWordSimilar

<% — pg_trgm: the column is similar to a part of the value (word similarity above the threshold). PostgreSQL extension.

values ​

values: typeof values

VALUES (...) list for Op.any / Op.all.

Example ​

ts
await User.findAll({ where: { age: { [Op.gte]: 18 }, name: { [Op.iLike]: 'a%' } } });

Released under the MIT License.