sequelize op.in example
Example 1: op in sequelize
//First method
// selecting authorityId :12 or 13
model.findAll({
where: {
[Op.or]: [
{ authorId: 12 },
{ authorId: 13 }
]
}
});
Example 2: in in sequelize
await Tag.findAll({
where: {
id: {
[Sequelize.Op.in]: [1, 2, 3, 4]
}
}
});
Example 3: op in sequelize
// second method
// selecting authorityId :12 or 13
model.findAll({
where: {
authorId: {
[Op.or]: [12, 13]
}
}
});