不要怂,就是干,撸起袖子干!

Commit 5f8b7bd1 by Alexey Torkhov

Fix error in docs

1 parent 12e2a873
Showing with 2 additions and 2 deletions
...@@ -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
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!