sequelize-sscce icon indicating copy to clipboard operation
sequelize-sscce copied to clipboard

SSCCE for startsWith issue in Sequalize.where

Open amitrana-dev opened this issue 3 years ago • 0 comments

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');

amitrana-dev avatar Dec 09 '21 09:12 amitrana-dev