sequelize-sscce
sequelize-sscce copied to clipboard
SSCCE for startsWith issue in Sequalize.where
Using startsWith & endsWith with sequelize.where and % operator isn't being placed on the condition.
Condition:
Foo.count({where: { [Op.and]: [ Sequelize.where(Sequelize.col('name'),Op.startsWith,'fo') ] } })
Expected Query:
SELECT count(*) AS countFROMFoosASFoo WHERE (name LIKE 'fo%');
Actual Query:
SELECT count(*) AS countFROMFoosASFoo WHERE (name LIKE 'fo');