title: Create n:m objects using json and sequelize?
body: <p>I am trying to learn sequelize, but am having trouble getting a n:m object created.  So far I have my 2 models that create 3 tables (Store, Product, StoreProducts) and the models below:</p>
  
  <p>models/Store.js</p>
  
  <pre><code>module.exports = (sequelize, DataTypes) =&gt; {
      return Store = sequelize.define('Store', {
          name: {
              type: DataTypes.STRING,
          },
          address: {
              type: DataTypes.STRING,
          }
      });
  };
  </code></pre>
  
  <p>models/Product.js</p>
  
  <pre><code>module.exports = function(sequelize, DataTypes) {
    return Product = sequelize.define('Product', { 
          name: {
              type: DataTypes.STRING,
          }
    });
  };
  </code></pre>
  
  <p>models/Index.js</p>
  
  <pre><code> models.Store.belongsToMany(models.Products, {through: 'StoreProducts', foreignKey: 'storeId'});
   models.Products.belongsToMany(models.Store, {through: 'StoreProducts', foreignKey: 'productId'});
  </code></pre>
  
  <p>I want to "add" the following json object.</p>
  
  <pre><code> var store = {
     name:'corner store',
     address: '123 Main Street',
     products: [
       'string beans', 'coffee', 'milk'
     ]
   };
  </code></pre>
  
  <p>Looking for any direction, I've tried about 10 routes and the best I was able to get was the Store and Product records created, but nothing relational.</p>