Level 29
let users = UserModel.findAll({
include: {
model: PlanModel,
where: {
status: "active",
},
},
});
i have a sequelise relationship i am doing like
let user = UserModel.findAll({
inclide: PlanModel
});
Here i want to get all users with their plans but i want only plans for example with status = active. how can i add that extra filter. i want to return null plan when it doesn't meet status active
Please or to participate in this conversation.