Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
docs(query-interface): add bulkUpdate docs (#10005)
  • Loading branch information
c-moss-talk authored and sushantdhiman committed Oct 9, 2018
1 parent 9f58b82 commit 985c1d4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/query-interface.js
Expand Up @@ -971,6 +971,25 @@ class QueryInterface {
return this.sequelize.query(sql, options);
}

/**
* Update multiple records of a table
*
* @example
* queryInterface.bulkUpdate('roles', {
* label: 'admin',
* }, {
* userType: 3,
* },
* );
*
* @param {string} tableName Table name to update
* @param {Object} values Values to be inserted, mapped to field name
* @param {Object} identifier A hash with conditions OR an ID as integer OR a string with conditions
* @param {Object} [options] Various options, please see Model.bulkCreate options
* @param {Object} [attributes] Attributes on return objects if supported by SQL dialect
*
* @returns {Promise}
*/
bulkUpdate(tableName, values, identifier, options, attributes) {
options = Utils.cloneDeep(options);
if (typeof identifier === 'object') identifier = Utils.cloneDeep(identifier);
Expand Down

0 comments on commit 985c1d4

Please sign in to comment.