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 63b360c3
authored
Oct 14, 2015
by
Mick Hansen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4660 from atorkhov/patch-1
Fix typo in docs
2 parents
206cb688
5f8b7bd1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
docs/docs/querying.md
docs/docs/querying.md
View file @
63b360c
...
@@ -40,12 +40,12 @@ Sometimes it may be tiresome to list all the attributes of the model if you only
...
@@ -40,12 +40,12 @@ Sometimes it may be tiresome to list all the attributes of the model if you only
```
js
```
js
// This is a tiresome way of getting the number of hats...
// This is a tiresome way of getting the number of hats...
Model
.
findAll
({
Model
.
findAll
({
attributes
:
[
'id'
,
'foo'
,
'bar'
,
'baz'
,
'quz'
,
sequelize
.
fn
(
'COUNT'
,
sequelize
.
col
(
'hats'
)),
'no_hats'
]
attributes
:
[
'id'
,
'foo'
,
'bar'
,
'baz'
,
'quz'
,
[
sequelize
.
fn
(
'COUNT'
,
sequelize
.
col
(
'hats'
)),
'no_hats'
]
]
});
});
// This is shorter, and less error prone because it still works if you add / remove attributes
// This is shorter, and less error prone because it still works if you add / remove attributes
Model
.
findAll
({
Model
.
findAll
({
attributes
:
{
include
:
[
sequelize
.
fn
(
'COUNT'
,
sequelize
.
col
(
'hats'
)),
'no_hats'
]]
}
attributes
:
{
include
:
[
[
sequelize
.
fn
(
'COUNT'
,
sequelize
.
col
(
'hats'
)),
'no_hats'
]]
}
});
});
```
```
```
sql
```
sql
...
...
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