The JS type of the attribute the operator is operating on.
See https://sequelize.org/docs/v7/core-concepts/model-querying-basics/#operators
Optional
[adjacent]PG only
Whether the two ranges are adjacent.
{ rangeAttribute: { [Op.adjacent]: [1, 2] } }
// results in
// "rangeAttribute" -|- [1, 2)
Optional
[between][Op.between]: [6, 10],
becomes BETWEEN 6 AND 10
Optional
[contained]PG array & range 'contained by' operator
[Op.contained]: [1, 2]
becomes <@ [1, 2]
Optional
[contains]PG array & range 'contains' operator
[Op.contains]: [1, 2]
becomes @> [1, 2]
Optional
[endsString ends with value.
Optional
[eq][Op.eq]: 6,
becomes = 6
[Op.eq]: [6, 7]
becomes = ARRAY[6, 7]
[Op.eq]: null
becomes IS NULL
[Op.eq]: true
becomes = true
[Op.eq]: literal('raw sql')
becomes = raw sql
[Op.eq]: col('column')
becomes = "column"
[Op.eq]: fn('NOW')
becomes = NOW()
Optional
[gt][Op.gt]: 6
becomes > 6
Optional
[gte][Op.gte]: 6
becomes >= 6
Optional
[icase insensitive PG only
[Op.iLike]: '%hat'
becomes ILIKE '%hat'
[Op.iLike]: { [Op.any]: ['cat', 'hat']}
becomes ILIKE ANY (ARRAY['cat', 'hat'])
Optional
[iPG only
Matches regular expression, case insensitive
[Op.iRegexp]: '^[h|a|t]'
becomes ~* '^[h|a|t]'
Optional
[in][Op.in]: [1, 2],
becomes IN (1, 2)
Optional
[is][Op.is]: null
becomes IS NULL
[Op.is]: true
becomes IS TRUE
[Op.is]: literal('value')
becomes IS value
Optional
[like][Op.like]: '%hat',
becomes LIKE '%hat'
[Op.like]: { [Op.any]: ['cat', 'hat'] }
becomes LIKE ANY (ARRAY['cat', 'hat'])
Optional
[lt][Op.lt]: 10
becomes < 10
Optional
[lte][Op.lte]: 10
becomes <= 10
Optional
[match][Op.match]: Sequelize.fn('to_tsquery', 'fat & rat')
becomes @@ to_tsquery('fat & rat')
Optional
[ne][Op.ne]: 20,
becomes != 20
[Op.ne]: [20, 21]
becomes != ARRAY[20, 21]
[Op.ne]: null
becomes IS NOT NULL
[Op.ne]: true
becomes != true
[Op.ne]: literal('raw sql')
becomes != raw sql
[Op.ne]: col('column')
becomes != "column"
[Op.ne]: fn('NOW')
becomes != NOW()
Optional
[noPG only
Whether the range extends to the left of the other range.
{ rangeAttribute: { [Op.noExtendLeft]: [1, 2] } }
// results in
// "rangeAttribute" &> [1, 2)
Optional
[noPG only
Whether the range extends to the right of the other range.
{ rangeAttribute: { [Op.noExtendRight]: [1, 2] } }
// results in
// "rangeAttribute" &< [1, 2)
Optional
[not[Op.notBetween]: [11, 15],
becomes NOT BETWEEN 11 AND 15
Optional
[notString not ends with value.
Optional
[notILike]PG only
[Op.notILike]: '%hat'
becomes NOT ILIKE '%hat'
[Op.notILike]: { [Op.any]: ['cat', 'hat']}
becomes NOT ILIKE ANY (ARRAY['cat', 'hat'])
Optional
[notIRegexp]PG only
Does not match regular expression, case insensitive
[Op.notIRegexp]: '^[h|a|t]'
becomes !~* '^[h|a|t]'
Optional
[not[Op.notIn]: [1, 2],
becomes NOT IN (1, 2)
Optional
[not[Op.notLike]: '%hat'
becomes NOT LIKE '%hat'
[Op.notLike]: { [Op.any]: ['cat', 'hat']}
becomes NOT LIKE ANY (ARRAY['cat', 'hat'])
Optional
[notMySQL/PG only
Does not match regular expression, case sensitive
[Op.notRegexp]: '^[h|a|t]'
becomes NOT REGEXP/!~ '^[h|a|t]'
Optional
[notStrings not starts with value.
Optional
[notString not contains value.
Optional
[not][Op.not]: true
becomes IS NOT TRUE
{ col: { [Op.not]: { [Op.gt]: 5 } } }
becomes NOT (col > 5)
Optional
[overlap]PG array & range 'overlaps' operator
[Op.overlap]: [1, 2]
becomes && [1, 2]
Optional
[regexp]MySQL/PG only
Matches regular expression, case sensitive
[Op.regexp]: '^[h|a|t]'
becomes REGEXP/~ '^[h|a|t]'
Optional
[startsStrings starts with value.
Optional
[strictPG only
Whether the range is strictly left of the other range.
{ rangeAttribute: { [Op.strictLeft]: [1, 2] } }
// results in
// "rangeAttribute" << [1, 2)
Optional
[strictPG only
Whether the range is strictly right of the other range.
{ rangeAttribute: { [Op.strictRight]: [1, 2] } }
// results in
// "rangeAttribute" >> [1, 2)
Optional
[substring]String contains value.
Generated using TypeDoc
Operators that can be used in WhereOptions