I am trying to filter my query by the attributes of the joining table
I have 2 tables Cities and Categories which I am associating through a third table CityCategory
When querying the through table, you should use through.where
through.where
include: [{ model: Category, through: { where: {year: 2015}}, attributes: ['id'] }]
You might want to add required: true to turn the include to an inner join
required: true