I'm using Sequlize 5 with PostgreSQL. How do I generate the following query in sequelize?
SELECT * FROM myTable
WHERE col1*col2 = 50
AND col3 = 'somthing'
Thanks to Chris G, I finally worked it out by using Op.and, Sequelize.where and Sequelize.literal. This is the solution I achieved:
MyTable.findAll({
where: {
[Op.and]: [
Sequelize.where(Sequelize.literal('col1*col2'), 50),
{ col3: 'somethimg' },
],
},
});