include attributes sequelize code example
Example 1: include with where clause in sequelize
Document.findAll({
where: {'$employee.manager.id$': id},
include: [{
model: models.Employee,
required: true,
as: 'employee',
include: [{
model: models.Manager,
required: true,
as: 'manager',
where: { id: managerId },
}],
}],
Example 2: sequelize attributes
Model.findAll({
attributes: ['foo', 'bar']
});