You basically just have to put stuff into the chainer, run it und iterate over the results:
Example: You have a User with a name and Posts with text. When a Post’s text starts with the name of the User, it is related to him:
User.all().success(function(users) {
var q = new Sequelize.Utils.QueryChainer();
users.forEach(function(u) {
q.add(Post.findAll({ where: ["`text` LIKE '" +
u.name + "%'"] }));
});
q.run().success(function(results) {
console.log("Posts of the user "+users[0].name+":", results[0].map(function(p) { return p.values }))
console.log("Posts of the user "+users[1].name+":", results[1].map(function(p) { return p.values }))
})
})