title: Select from many-to-many relationship sequelize
body: <p>I tried to select from a table with reference another table. I have a relationship many-to-many between table food and table Ingredients.</p>
  
  <p>Food model:</p>
  
  <pre><code>module.exports = function(sequelize, DataTypes) {
    return sequelize.define('food', {
      id: {
        type: DataTypes.INTEGER(10),
        allowNull: false,
        primaryKey: true,
        autoIncrement: true
      },
      name_food: {
        type: DataTypes.STRING,
        allowNull: false
      }
    }, {
      tableName: 'food',
      freezeTableName: true
    });
  };
  </code></pre>
  
  <p>Food_ingredients model:</p>
  
  <pre><code>module.exports = function(sequelize, DataTypes) {
    return sequelize.define('food_ingredients', {
      id: {
        type: DataTypes.INTEGER(10),
        allowNull: false,
        primaryKey: true,
        autoIncrement: true
      },
      food_id: {
        type: DataTypes.INTEGER(10),
        allowNull: false,
        references: {
          model: 'food',
          key: 'id'
        }
      },
      ingredient_id: {
        type: DataTypes.INTEGER(10),
        allowNull: false,
        references: {
          model: 'ingredients',
          key: 'id'
        }
      }
    }, {
      tableName: 'food_ingredients',
      freezeTableName: true
    });
  };
  </code></pre>
  
  <p>Ingredients model:</p>
  
  <pre><code>module.exports = function(sequelize, DataTypes) {
    return sequelize.define('ingredients', {
      id: {
        type: DataTypes.INTEGER(10),
        allowNull: false,
        primaryKey: true,
        autoIncrement: true
      },
      name_ingredient: {
        type: DataTypes.STRING,
        allowNull: false
      }
    }, {
      tableName: 'ingredients',
      freezeTableName: true,
      timestamps: false
    });
  };
  </code></pre>
  
  <p>My problem is that I don't know how to make a natural join on this tables with sequelize. I tried something like this:</p>
  
  <pre><code>Food.findAll({include: [
      {
        model: Food_Ingredients
      }
    ]}).then(responseWithResult(res))
       .catch(handleError(res));
  </code></pre>
  
  <p>But I received this error:</p>
  
  <blockquote>
    <p>food_incredients is not associated to food!</p>
  </blockquote>
  
  <p>So, I how can I query that with sequelize?</p>
  
  <p>Thanks.</p>