I want to get query like this with sequelize ORM:
SELECT \"A\".*,
FROM \"A\"
LEFT OUTER JOIN \"B\" ON \"A\".\"bId\" = \"B\".\"id\"
LEFT OUTER JOIN \"
Add the where condition in the include, along with join.
{
model: C,
where: {
id: 1
}
}
Wrap the columns which reference joined tables in $$
A.findAll({
where: {
$or: [
{'$B.userId$' : 100},
{'$C.userId$' : 100}
]
},
include: [{
model: B,
required: false
}, {
model: C,
required: false
}]
});