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

Commit e01e683b by Mick Hansen

Merge pull request #5635 from aminRX/master

Docs: Added Ordering Eager Loaded Associations option.
2 parents d24a49f4 2229aff4
Showing with 4 additions and 0 deletions
...@@ -582,6 +582,10 @@ Company.findAll({ ...@@ -582,6 +582,10 @@ Company.findAll({
order: [ [ { model: Division, as: 'Div' }, 'name' ] ] order: [ [ { model: Division, as: 'Div' }, 'name' ] ]
}); });
Company.findAll({ Company.findAll({
include: [ { model: Division, as: 'Div' } ],
order: [ [ { model: Division, as: 'Div' }, 'name', 'DESC' ] ]
});
Company.findAll({
include: [ { model: Division, include: [ Department ] } ], include: [ { model: Division, include: [ Department ] } ],
order: [ [ Division, Department, 'name' ] ] order: [ [ Division, Department, 'name' ] ]
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!