Documentation
    Preparing search index...

    Interface WhereOperators<AttributeType>

    Operators that can be used in WhereOptions

    interface WhereOperators<AttributeType = any> {
        "[adjacent]"?: AttributeType extends Range<RangeType>
            ? Rangable<RangeType>
            : DynamicValues<AttributeType>;
        "[allKeysExist]"?: string[] | DynamicValues<string[]>;
        "[anyKeyExists]"?: string[] | DynamicValues<string[]>;
        "[between]"?:
            | Literal
            | [
                lowerInclusive: OperatorValues<NonNullable<AttributeType>>,
                higherInclusive: OperatorValues<NonNullable<AttributeType>>,
            ];
        "[contained]"?: AttributeType extends any[]
            ? | AllowAnyAll<
                (
                    DynamicValues<AttributeType> | (AttributeType extends Range<infer RangeType> ? Rangable<RangeType> : AttributeType extends any[] ? StaticValues<...> : never)
                ),
            >
            | undefined
            : AllowAnyAll<OperatorValues<Rangable<AttributeType>>>;
        "[contains]"?: AttributeType extends Range<RangeType>
            ? OperatorValues<OperatorValues<NonNullable<RangeType>>>
            : AttributeType extends object
                ? OperatorValues<Partial<AttributeType>>
                :
                    | AllowAnyAll<
                        (
                            DynamicValues<AttributeType> | (AttributeType extends Range<infer RangeType> ? Rangable<RangeType> : AttributeType extends any[] ? StaticValues<...> : never)
                        ),
                    >
                    | undefined;
        "[endsWith]"?: OperatorValues<Extract<AttributeType, string>>;
        "[eq]"?: AllowAnyAll<OperatorValues<AttributeType>>;
        "[gt]"?: AllowAnyAll<OperatorValues<NonNullable<AttributeType>>>;
        "[gte]"?: AllowAnyAll<OperatorValues<NonNullable<AttributeType>>>;
        "[iLike]"?: AllowAnyAll<OperatorValues<Extract<AttributeType, string>>>;
        "[in]"?: Literal | readonly OperatorValues<NonNullable<AttributeType>>[];
        "[iRegexp]"?: AllowAnyAll<OperatorValues<Extract<AttributeType, string>>>;
        "[is]"?: Literal | Extract<AttributeType, boolean | null>;
        "[isNot]"?: Literal | Extract<AttributeType, boolean | null>;
        "[like]"?: AllowAnyAll<OperatorValues<Extract<AttributeType, string>>>;
        "[lt]"?: AllowAnyAll<OperatorValues<NonNullable<AttributeType>>>;
        "[lte]"?: AllowAnyAll<OperatorValues<NonNullable<AttributeType>>>;
        "[match]"?: AllowAnyAll<DynamicValues<AttributeType>>;
        "[ne]"?: AllowAnyAll<OperatorValues<AttributeType>>;
        "[noExtendLeft]"?: AttributeType extends Range<RangeType>
            ? Rangable<RangeType>
            : DynamicValues<AttributeType>;
        "[noExtendRight]"?: AttributeType extends Range<RangeType>
            ? Rangable<RangeType>
            : DynamicValues<AttributeType>;
        "[notBetween]"?:
            | Literal
            | [
                lowerInclusive: OperatorValues<NonNullable<AttributeType>>,
                higherInclusive: OperatorValues<NonNullable<AttributeType>>,
            ];
        "[notEndsWith]"?: OperatorValues<Extract<AttributeType, string>>;
        "[notILike]"?: AllowAnyAll<OperatorValues<Extract<AttributeType, string>>>;
        "[notIn]"?: Literal | readonly OperatorValues<NonNullable<AttributeType>>[];
        "[notIRegexp]"?: AllowAnyAll<
            OperatorValues<Extract<AttributeType, string>>,
        >;
        "[notLike]"?: AllowAnyAll<OperatorValues<Extract<AttributeType, string>>>;
        "[notRegexp]"?: AllowAnyAll<OperatorValues<Extract<AttributeType, string>>>;
        "[notStartsWith]"?: OperatorValues<Extract<AttributeType, string>>;
        "[notSubstring]"?: OperatorValues<Extract<AttributeType, string>>;
        "[overlap]"?: AllowAnyAll<
            (
                DynamicValues<AttributeType> | (AttributeType extends Range<infer RangeType> ? Rangable<RangeType> : AttributeType extends any[] ? StaticValues<...> : never)
            ),
        >;
        "[regexp]"?: AllowAnyAll<OperatorValues<Extract<AttributeType, string>>>;
        "[startsWith]"?: OperatorValues<Extract<AttributeType, string>>;
        "[strictLeft]"?: AttributeType extends Range<RangeType>
            ? Rangable<RangeType>
            : DynamicValues<AttributeType>;
        "[strictRight]"?: AttributeType extends Range<RangeType>
            ? Rangable<RangeType>
            : DynamicValues<AttributeType>;
        "[substring]"?: OperatorValues<Extract<AttributeType, string>>;
    }

    Type Parameters

    Index
    "[adjacent]"?: AttributeType extends Range<RangeType>
        ? Rangable<RangeType>
        : DynamicValues<AttributeType>

    PG only

    Whether the two ranges are adjacent.

    { rangeAttribute: { [Op.adjacent]: [1, 2] } }
    // results in
    // "rangeAttribute" -|- [1, 2)

    https://www.postgresql.org/docs/14/functions-range.html

    "[allKeysExist]"?: string[] | DynamicValues<string[]>

    PG only

    Check if all of these array strings exist as top-level keys.

    { jsonbAttribute: { [Op.allKeysExist]: ['a','b'] } }
    // results in
    // "jsonbAttribute" ?& ARRAY['a','b']

    https://www.postgresql.org/docs/current/functions-json.html

    "[anyKeyExists]"?: string[] | DynamicValues<string[]>

    PG only

    Check if any of these array strings exist as top-level keys.

    { jsonbAttribute: { [Op.anyKeyExists]: ['a','b'] } }
    // results in
    // "jsonbAttribute" ?| ARRAY['a','b']

    https://www.postgresql.org/docs/current/functions-json.html

    "[between]"?:
        | Literal
        | [
            lowerInclusive: OperatorValues<NonNullable<AttributeType>>,
            higherInclusive: OperatorValues<NonNullable<AttributeType>>,
        ]
    `[Op.between]: [6, 10],` becomes `BETWEEN 6 AND 10`
    
    "[contained]"?: AttributeType extends any[]
        ? | AllowAnyAll<
            (
                DynamicValues<AttributeType> | (AttributeType extends Range<infer RangeType> ? Rangable<RangeType> : AttributeType extends any[] ? StaticValues<...> : never)
            ),
        >
        | undefined
        : AllowAnyAll<OperatorValues<Rangable<AttributeType>>>

    PG array & range 'contained by' operator

    `[Op.contained]: [1, 2]` becomes `<@ [1, 2]`
    
    "[contains]"?: AttributeType extends Range<RangeType>
        ? OperatorValues<OperatorValues<NonNullable<RangeType>>>
        : AttributeType extends object
            ? OperatorValues<Partial<AttributeType>>
            :
                | AllowAnyAll<
                    (
                        DynamicValues<AttributeType> | (AttributeType extends Range<infer RangeType> ? Rangable<RangeType> : AttributeType extends any[] ? StaticValues<...> : never)
                    ),
                >
                | undefined

    PG array & range 'contains' operator

    `[Op.contains]: [1, 2]` becomes `@> [1, 2]`
    
    "[endsWith]"?: OperatorValues<Extract<AttributeType, string>>

    String ends with value.

    "[eq]"?: AllowAnyAll<OperatorValues<AttributeType>>
    `[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()`
    
    "[gt]"?: AllowAnyAll<OperatorValues<NonNullable<AttributeType>>>
    `[Op.gt]: 6` becomes `> 6`
    
    "[gte]"?: AllowAnyAll<OperatorValues<NonNullable<AttributeType>>>
    `[Op.gte]: 6` becomes `>= 6`
    
    "[iLike]"?: AllowAnyAll<OperatorValues<Extract<AttributeType, string>>>

    case insensitive PG only

    `[Op.iLike]: '%hat'` becomes `ILIKE '%hat'`
    
    `[Op.iLike]: { [Op.any]: ['cat', 'hat']}` becomes `ILIKE ANY (ARRAY['cat', 'hat'])`
    
    "[in]"?: Literal | readonly OperatorValues<NonNullable<AttributeType>>[]
    `[Op.in]: [1, 2],` becomes `IN (1, 2)`
    
    "[iRegexp]"?: AllowAnyAll<OperatorValues<Extract<AttributeType, string>>>

    PG only

    Matches regular expression, case insensitive

    `[Op.iRegexp]: '^[h|a|t]'` becomes `~* '^[h|a|t]'`
    
    "[is]"?: Literal | Extract<AttributeType, boolean | null>
    `[Op.is]: null` becomes `IS NULL`
    
    `[Op.is]: true` becomes `IS TRUE`
    
    `[Op.is]: literal('value')` becomes `IS value`
    
    "[isNot]"?: Literal | Extract<AttributeType, boolean | null>

    Example: [Op.isNot]: null, becomes IS NOT NULL

    "[like]"?: AllowAnyAll<OperatorValues<Extract<AttributeType, string>>>
    `[Op.like]: '%hat',` becomes `LIKE '%hat'`
    
    `[Op.like]: { [Op.any]: ['cat', 'hat'] }` becomes `LIKE ANY (ARRAY['cat', 'hat'])`
    
    "[lt]"?: AllowAnyAll<OperatorValues<NonNullable<AttributeType>>>
    `[Op.lt]: 10` becomes `< 10`
    
    "[lte]"?: AllowAnyAll<OperatorValues<NonNullable<AttributeType>>>
    `[Op.lte]: 10` becomes `<= 10`
    
    `[Op.match]: Sequelize.fn('to_tsquery', 'fat & rat')` becomes `@@ to_tsquery('fat & rat')`
    
    "[ne]"?: AllowAnyAll<OperatorValues<AttributeType>>
    `[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()`
    
    "[noExtendLeft]"?: AttributeType extends Range<RangeType>
        ? Rangable<RangeType>
        : DynamicValues<AttributeType>

    PG only

    Whether the range extends to the left of the other range.

    { rangeAttribute: { [Op.noExtendLeft]: [1, 2] } }
    // results in
    // "rangeAttribute" &> [1, 2)

    https://www.postgresql.org/docs/14/functions-range.html

    "[noExtendRight]"?: AttributeType extends Range<RangeType>
        ? Rangable<RangeType>
        : DynamicValues<AttributeType>

    PG only

    Whether the range extends to the right of the other range.

    { rangeAttribute: { [Op.noExtendRight]: [1, 2] } }
    // results in
    // "rangeAttribute" &< [1, 2)

    https://www.postgresql.org/docs/14/functions-range.html

    "[notBetween]"?:
        | Literal
        | [
            lowerInclusive: OperatorValues<NonNullable<AttributeType>>,
            higherInclusive: OperatorValues<NonNullable<AttributeType>>,
        ]
    `[Op.notBetween]: [11, 15],` becomes `NOT BETWEEN 11 AND 15`
    
    "[notEndsWith]"?: OperatorValues<Extract<AttributeType, string>>

    String not ends with value.

    "[notILike]"?: AllowAnyAll<OperatorValues<Extract<AttributeType, string>>>

    PG only

    `[Op.notILike]: '%hat'` becomes `NOT ILIKE '%hat'`
    
    `[Op.notILike]: { [Op.any]: ['cat', 'hat']}` becomes `NOT ILIKE ANY (ARRAY['cat', 'hat'])`
    
    "[notIn]"?: Literal | readonly OperatorValues<NonNullable<AttributeType>>[]
    `[Op.notIn]: [1, 2],` becomes `NOT IN (1, 2)`
    
    "[notIRegexp]"?: AllowAnyAll<OperatorValues<Extract<AttributeType, string>>>

    PG only

    Does not match regular expression, case insensitive

    `[Op.notIRegexp]: '^[h|a|t]'` becomes `!~* '^[h|a|t]'`
    
    "[notLike]"?: AllowAnyAll<OperatorValues<Extract<AttributeType, string>>>
    `[Op.notLike]: '%hat'` becomes `NOT LIKE '%hat'`
    
    `[Op.notLike]: { [Op.any]: ['cat', 'hat']}` becomes `NOT LIKE ANY (ARRAY['cat', 'hat'])`
    
    "[notRegexp]"?: AllowAnyAll<OperatorValues<Extract<AttributeType, string>>>

    MySQL/PG only

    Does not match regular expression, case sensitive

    `[Op.notRegexp]: '^[h|a|t]'` becomes `NOT REGEXP/!~ '^[h|a|t]'`
    
    "[notStartsWith]"?: OperatorValues<Extract<AttributeType, string>>

    Strings not starts with value.

    "[notSubstring]"?: OperatorValues<Extract<AttributeType, string>>

    String not contains value.

    "[overlap]"?: AllowAnyAll<
        (
            DynamicValues<AttributeType> | (AttributeType extends Range<infer RangeType> ? Rangable<RangeType> : AttributeType extends any[] ? StaticValues<...> : never)
        ),
    >

    PG array & range 'overlaps' operator

    `[Op.overlap]: [1, 2]` becomes `&& [1, 2]`
    
    "[regexp]"?: AllowAnyAll<OperatorValues<Extract<AttributeType, string>>>

    MySQL/PG only

    Matches regular expression, case sensitive

    `[Op.regexp]: '^[h|a|t]'` becomes `REGEXP/~ '^[h|a|t]'`
    
    "[startsWith]"?: OperatorValues<Extract<AttributeType, string>>

    Strings starts with value.

    "[strictLeft]"?: AttributeType extends Range<RangeType>
        ? Rangable<RangeType>
        : DynamicValues<AttributeType>

    PG only

    Whether the range is strictly left of the other range.

    { rangeAttribute: { [Op.strictLeft]: [1, 2] } }
    // results in
    // "rangeAttribute" << [1, 2)

    https://www.postgresql.org/docs/14/functions-range.html

    "[strictRight]"?: AttributeType extends Range<RangeType>
        ? Rangable<RangeType>
        : DynamicValues<AttributeType>

    PG only

    Whether the range is strictly right of the other range.

    { rangeAttribute: { [Op.strictRight]: [1, 2] } }
    // results in
    // "rangeAttribute" >> [1, 2)

    https://www.postgresql.org/docs/14/functions-range.html

    "[substring]"?: OperatorValues<Extract<AttributeType, string>>

    String contains value.