Reputation: 1216
I am trying to do the following query equivalent in Sequelize
SELECT * FROM users u
WHERE concat('%', u.name, '%', u.surname,'%')
ILIKE '%?%?%';
Do you have some ideas of how to do a query like that in Sequelize, I already tried this, thinking it could be equivalent, but no luck.
user.findAll({
where: {
[Op.or]: [
{ name: { [Op.ilike]: '%someval%' } },
{ surname: { [Op.ilike]: '%someval%' } }
]
}
});
Upvotes: 1
Views: 2307
Reputation: 650
I think what you're looking for is Op.iLike
(uppercase L)
http://docs.sequelizejs.com/manual/tutorial/querying.html#operators
Upvotes: 1