brikteknologier / seraph-model

thin model layer for seraph/neo4j (node.js)
MIT License
111 stars 28 forks source link

Nested Includes #104

Closed JosephScript closed 8 years ago

JosephScript commented 8 years ago

It would be very convenient to support nested includes. For example, a user has todo lists, each with notes:

  Users.where({
    username: req.user.username
  },{
    limit: 1,
    include: {
      todos: {
        model: Todos,
        rel: 'has_todo',
        many: true,
        include:{
                notes: {
                model: Notes,
                rel: 'has_note',
                many: true
      }
      },function(err, nodes) {
    if (err) {
      next(err);
    } else {
      var user = nodes[0];
      console.log(user);
  }
  });
});

Is there a way to do something like this as is?

JosephScript commented 8 years ago

I just saw this is open in #62. Closing.