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

Commit 549037a7 by Jan Aagaard Meier

Merge pull request #3778 from syldor/nested-eager-loading-doc

add where clause
2 parents 72b97eff 7f0b9d78
Showing with 11 additions and 5 deletions
......@@ -538,11 +538,17 @@ This will produce an outer join. However, a `where` clause on a related model wi
```js
User.findAll({
include: [
{model: Tool, as: 'Instruments', include: [
{model: Teacher, include: [ /* etc */], required: false}
]}
]
include: [{
model: Tool,
as: 'Instruments',
include: [{
model: Teacher,
where: {
school: "Woodstock Music School"
},
required: false
}]
}]
}).then(function(users) {
/* ... */
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!