Hi,I have a working belongs to many relation on restaurant and food_type via restaurant_has_food_type.I can query restaurant with findAll without problem.But when I'm using findAndCountAll :
_models.restaurant.findAndCountAll( {include: [{model: _models.food_type,through: {attributes: []}}],where: ['food_type.id IN(1,2)'],offset: offset,limit: limit});
This generate the following sql :
Executing (default): SELECT count(*) AS `count` FROM `restaurant` AS `restaurant` WHERE food_type.id IN(1,2);error: SequelizeDatabaseError: ER_BAD_FIELD_ERROR: Champ 'food_type.id' inconnudans where clause