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 1fcd126b
authored
Nov 14, 2016
by
contra
Committed by
Sushant
Nov 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Execute queries parallel in findAndCount - Closes #6695 (#6696)
1 parent
8f2c71c8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
changelog.md
lib/model.js
changelog.md
View file @
1fcd126
# Future
# Future
-
[
FIXED
]
`restore`
now uses
`field`
from
`deletedAt`
-
[
FIXED
]
Execute queries parallel in findAndCount
[
#6695
](
https://github.com/sequelize/sequelize/issues/6695
)
-
[
FIXED
]
`restore`
now uses
`field`
from
`deletedAt`
-
[
FIXED
]
MSSQL bulkInsertQuery when options and attributes are not passed
-
[
FIXED
]
MSSQL bulkInsertQuery when options and attributes are not passed
-
[
FIXED
]
`DATEONLY`
now returns
`YYYY-MM-DD`
date string
[
#4858
]
(
https://github.com/sequelize/sequelize/issues/4858
)
-
[
FIXED
]
`DATEONLY`
now returns
`YYYY-MM-DD`
date string
[
#4858
]
(
https://github.com/sequelize/sequelize/issues/4858
)
-
[
FIXED
]
Issues with
`createFunction`
and
`dropFunction`
(PostgresSQL)
-
[
FIXED
]
Issues with
`createFunction`
and
`dropFunction`
(PostgresSQL)
...
...
lib/model.js
View file @
1fcd126
...
@@ -1757,14 +1757,18 @@ class Model {
...
@@ -1757,14 +1757,18 @@ class Model {
if
(
countOptions
.
attributes
)
{
if
(
countOptions
.
attributes
)
{
countOptions
.
attributes
=
undefined
;
countOptions
.
attributes
=
undefined
;
}
}
return
this
.
count
(
countOptions
).
then
(
count
=>
{
const
countQuery
=
this
.
count
(
countOptions
);
const
findQuery
=
this
.
findAll
(
options
);
return
countQuery
.
then
(
count
=>
{
if
(
count
===
0
)
{
if
(
count
===
0
)
{
return
{
return
{
count
:
count
||
0
,
count
:
count
||
0
,
rows
:
[]
rows
:
[]
};
};
}
}
return
this
.
findAll
(
options
)
.
then
(
results
=>
({
return
findQuery
.
then
(
results
=>
({
count
:
count
||
0
,
count
:
count
||
0
,
rows
:
results
rows
:
results
}));
}));
...
...
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