Sequelize Bulk Update Array Issue
<p>I have a list of records that I'm looking to bulk update with the adjusted values in the individual form fields. When I try to run a POST and update the records based on the values in the inputs, I run into an error at the Where clause and I'm wondering how I can parse my <code>discoverySourceId</code> value for the where clause or what would be the best method to use with my current setup.</p>

<pre><code>Error: Missing where attribute in the options parameter passed to update.
</code></pre>

<p><strong>Route:</strong></p>

<pre><code>var appRoutes   = express.Router();
var _ = require('lodash-node');
var async = require('async');
var models = require('../models/db-index');

    appRoutes.route('app/settings/discovery-sources')

    .get(function(req, res){
        models.DiscoverySource.findAll({
                where: {
                    organizationId: req.user.organizationId
                }, attributes: ['discoverySourceId', 'discoverySourceName']
            }).then(function(discoverySource){
            res.render('pages/app/settings-discovery-sources.hbs', {
                discoverySource: discoverySource
            });
        })
    })
        .post(function(req, res){
                console.log('POST Triggered');
                var sources = _.map(req.body.discoverySourceName, function (source) {
                    return {
                         discoverySourceName: source,
                         discoverySourceId: req.body.discoverySourceId
                    };
                });
                models.DiscoverySource.update(sources).then(function(){
                    console.log("Successful update");
                    res.redirect('/settings/discovery-sources');
                });
            });

**Form:**

    &lt;div class="row"&gt;
        &lt;div class="col-md-8 col-md-offset-2"&gt;
            &lt;div class="annotation-form"&gt;
                &lt;h2&gt;Discovery Sources&lt;/h2&gt;
                &lt;form action="/app/settings/discovery-sources" method="post"&gt;
                {{#each discoverySource}}
                    &lt;input type="hidden" name="discoverySourceId" value={{this.discoverySourceId}}&gt;
                    &lt;input type="text" name="discoverySourceName[0]" value="{{this.discoverySourceName}}"&gt;&lt;a href="#" id="settings-delete-discovery-source"&gt;Delete&lt;/a&gt;
                    &lt;br /&gt;
                {{else}}
                    &lt;p&gt;No Discovery Sources&lt;/p&gt;
                {{/each}}
                    &lt;button type="submit"&gt;Update Sources&lt;/button&gt;
                &lt;/form&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
</code></pre>

<p><strong>discoverySource:</strong></p>

<pre><code>module.exports = function(sequelize, DataTypes) {

var DiscoverySource = sequelize.define('discovery_source', {
    discoverySourceId: {
        type: DataTypes.INTEGER,
        field: 'discovery_source_id',
        autoIncrement: true,
        primaryKey: true,
        notNull: true,
    },
    discoverySourceName: {
        type: DataTypes.STRING,
        field: 'discovery_source_name'
    },
    organizationId: {
        type: DataTypes.TEXT,
        field: 'organization_id'
    },
},{
    freezeTableName: true
});
    return DiscoverySource;
}
</code></pre>