strongloop/loopback-datasource-juggler — pull request #324 by fabien (2014-10-10 12:30:34+00:00)
Title: Include scope

This allows the usage of all the filter params (where, order, fields, include, ...) on included relations.

The syntax is as follows `{ relation: '', scope: { ... } }`:

```
Category.find({
include: {relation: 'posts', scope:{
fields: ['title'], include: ['author'],
order: 'title DESC'
}}
}, function(err, categories) {
console.log(categories)
});

User.find({
include: {posts: {relation: 'categories', scope:{
order: 'seq DESC'
}}}
}, function(err, users) {
console.log(users)
});
```