sequelize function in model code example
Example 1: in in sequelize
await Tag.findAll({
where: {
id: {
[Sequelize.Op.in]: [1, 2, 3, 4]
}
}
});
Example 2: modele sequelize
module.exports = function (sequelize, DataTypes) { return sequelize.define('Locale', { id: { type: DataTypes.INTEGER, autoIncrement: true, primaryKey: true }, locale: { type: DataTypes.STRING, allowNull: false, unique: true, validate: { len: 2 } }, visible: { type: DataTypes.BOOLEAN, defaultValue: 1 } }) }