The left operand
The POJO containing the operators and the right operands
This version of where is used to opt back into the POJO syntax. Useful in combination with @sequelize/core!sql.
The left operand
The operator to use (one of the different values available in the Op object)
The right operand
A way of writing an SQL binary operator, or more complex where conditions.
This solution is slightly more verbose than the POJO syntax, but allows any value on the left hand side of the operator (unlike the POJO syntax which only accepts attribute names). For instance, either the left or right hand side of the operator can be @sequelize/core!sql.fn, @sequelize/core!sql.col, @sequelize/core!sql.literal etc.
If your left operand is an attribute name, using the regular POJO syntax (
{ where: { attrName: value }}) syntax is usually more convenient.⚠️ Unlike the POJO syntax, if the left operand is a string, it will be treated as a value, not an attribute name. If you wish to refer to an attribute, use Attribute instead.