$ open source · GPL-3.0 — need a commercial license? imqueue.com →

FILTER_OPS variable

Maps each $-prefixed filter operator to the Sequelize Op symbol it means.

Signature:

FILTER_OPS: {
    $and: symbol;
    $or: symbol;
    $gt: symbol;
    $gte: symbol;
    $lt: symbol;
    $lte: symbol;
    $ne: symbol;
    $eq: symbol;
    $not: symbol;
    $between: symbol;
    $notBetween: symbol;
    $in: symbol;
    $notIn: symbol;
    $like: symbol;
    $notLike: symbol;
    $iLike: symbol;
    $notILike: symbol;
    $regexp: symbol;
    $notRegexp: symbol;
    $iRegexp: symbol;
    $notIRegexp: symbol;
    $overlap: symbol;
    $contains: symbol;
    $contained: symbol;
    $any: symbol;
    $adjacent: symbol;
    $strictLeft: symbol;
    $strictRight: symbol;
    $noExtendRight: symbol;
    $noExtendLeft: symbol;
}

Remarks

This mapping is the reason FilterInput exists at all. Sequelize's operators are ES symbols, and a symbol cannot be serialized — so a filter built with Op.gt on a client would arrive at the service as an empty object. The remote caller sends the string $gt instead, and query.toWhereOptions swaps in the symbol on this side.

Only the operators listed here are translated. Any other key is passed through as written, on the assumption that it is a column name — so a mistyped $gtt becomes a filter on a column called $gtt rather than an error.