How can I achieve this in Sequelize?
SELECT * FROM table where lower(column) LIKE ('abcd%');
I can't find a way to mix lower function with $like
You should use Sequelize.Op :
Table.findAll({ where: { name: { [Sequelize.Op.iLike]: searchQuery } } })
Don't forget to add % before or after your searchQuery, if you want to make a partial query.
See the docs here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With