I am using sequelize v6 on my nodejs/express application. I am struggling to use an attribute of my model in the where clause of my findAll query.
What I want to achieve in SQL:
SELECT field1, field2, field3 FROM myTable
WHERE field2 != field3
what i have in my javascript:
const resultArray = myTable.findAll({
attributes: [
"field1",
"field2",
"field3",],
where: {
field2: { [Op.ne]: {field3}},
})
What I am after is the right context to reference field3 in the [Op.ne] parameter.