lib/plugins/query.js
function (vals, /*?object*/query, options) {
            options = options || {};
            var dataset = this.dataset;
            return this._checkTransaction(options, function () {
                if (!isUndefined(query)) {
                    dataset = dataset.filter(query);
                }
                return dataset.update(vals);
            });
        }
function (vals, /*?object*/query, options) {
            options = options || {};
            var dataset = this.dataset;
            return this._checkTransaction(options, function () {
                if (!isUndefined(query)) {
                    dataset = dataset.filter(query);
                }
                return dataset.update(vals);
            });
        }
function ( vals , /*?object*/ query , options ) { options = options || { } ; var dataset = this . dataset ; return this . _checkTransaction ( options , function ( ) { if ( ! isUndefined ( query ) ) { dataset = dataset . filter ( query ) ; } return dataset . update ( vals ) ; } ) ; }
Update multiple rows with a set of values.

@example
var User = patio.getModel("user");

//BEGIN
//UPDATE `user` SET `password` = NULL WHERE (`last_accessed` <= '2011-01-27')
//COMMIT
User.update({password : null}, function(){
return this.lastAccessed.lte(comb.date.add(new Date(), "year", -1));
});
//same as
User.update({password : null}, {lastAccess : {lte : comb.date.add(new Date(), "year", -1)}});

//UPDATE `user` SET `password` = NULL WHERE (`last_accessed` <= '2011-01-27')
User.update({password : null}, function(){
return this.lastAccessed.lte(comb.date.add(new Date(), "year", -1));
}, {transaction : false});

@param {Object} vals a hash of values to update. See {@link patio.Dataset#update}.
@param query a filter to apply to the UPDATE.  See {@link patio.Dataset#filter}.

@param {Object} [options] additional options.
@param {Boolean} [options.transaction] boolean indicating if a transaction should be used when
updating the models.

@return {Promise} a promise that is resolved once the update statement has completed.
Update multiple rows with a set of values .