Sequelize: overlapping - Checking if any value in array matches any value in the passed array
You are looking for overlapping values. Any value in you weekDays
array that matches any values in your passed in array.
As such, you can use the PG specific Sequelize.Op.overlap
operator:
Can then be used like
Events.findOne({ where: { weekDays: { [Sequelize.Op.overlap]: [2, 3], }, },});