不要怂,就是干,撸起袖子干!

Commit 985c1d45 by Cameron Moss Committed by Sushant

docs(query-interface): add bulkUpdate docs (#10005)

1 parent 9f58b823
Showing with 19 additions and 0 deletions
...@@ -971,6 +971,25 @@ class QueryInterface { ...@@ -971,6 +971,25 @@ class QueryInterface {
return this.sequelize.query(sql, options); 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) { bulkUpdate(tableName, values, identifier, options, attributes) {
options = Utils.cloneDeep(options); options = Utils.cloneDeep(options);
if (typeof identifier === 'object') identifier = Utils.cloneDeep(identifier); if (typeof identifier === 'object') identifier = Utils.cloneDeep(identifier);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!