diff --git a/lib/query-interface.js b/lib/query-interface.js index edea77864933..9e313cbc6ca1 100644 --- a/lib/query-interface.js +++ b/lib/query-interface.js @@ -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);