sequelize join by field code example
Example: sequelize left join attributes
Users.findAll({
include: [
{
model: Role,
as: 'roles',
attributes: ['columnNameToInclude']
}
]
});
Users.findAll({
include: [
{
model: Role,
as: 'roles',
attributes: ['columnNameToInclude']
}
]
});