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 ffc59576
authored
Mar 22, 2016
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ci skip] docs(update) Use spread when getting the number of affected rows. Fixed #5620
1 parent
0b6660a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
docs/docs/instances.md
docs/docs/instances.md
View file @
ffc5957
...
@@ -161,8 +161,11 @@ Task.bulkCreate([
...
@@ -161,8 +161,11 @@ Task.bulkCreate([
{
status
:
'inactive'
},
/* set attributes' value */
,
{
status
:
'inactive'
},
/* set attributes' value */
,
{
where
:
{
subject
:
'programming'
}}
/* where criteria */
{
where
:
{
subject
:
'programming'
}}
/* where criteria */
);
);
}).
then
(
function
(
affectedRows
)
{
}).
spread
(
function
(
affectedCount
,
affectedRows
)
{
// affectedRows will be 2
// .update returns two values in an array, therefore we use .spread
// Notice that affectedRows will only be defined in dialects which support returning: true
// affectedCount will be 2
return
Task
.
findAll
();
return
Task
.
findAll
();
}).
then
(
function
(
tasks
)
{
}).
then
(
function
(
tasks
)
{
console
.
log
(
tasks
)
// the 'programming' tasks will both have a status of 'inactive'
console
.
log
(
tasks
)
// the 'programming' tasks will both have a status of 'inactive'
...
...
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