Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 985c1d45
authored
Oct 09, 2018
by
Cameron Moss
Committed by
Sushant
Oct 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs(query-interface): add bulkUpdate docs (#10005)
1 parent
9f58b823
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
lib/query-interface.js
lib/query-interface.js
View file @
985c1d4
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment