How to perform nested include ? I have table products that has one to many relation with comments, and table comments has many to one relation with users table. So comments has user_id, and product_id. My code is like this
var models = require('../models');
models.products.findAll({
include: [
{model: models.comments}
]
}).then(function (products) {
next(products);
}).catch(function (err) {
next(err);
});
});
I get the comments, but I would like to have something like
models.products.findAll({
include: [
{model: models.comments.include(models.comments.users)}
]
})
Is this possible without writing custom queries ?