sequelize include with as code example
Example 1: sequelize include only
Payment.findAll({
where: {
DairyId: req.query.dairyid
},
attributes: {
exclude: ['createdAt', 'updatedAt']
},
include: {
model: Customer,
attributes:['customerName', 'phoneNumber']
}
})
Example 2: sequelize include twice
Test.findAll({
include: [
{ model: Model1 },
{ model: Model2 }
]
});