There are 3 models in my database:
Section (1:m) Sub_Section (1:m) Questions
These 3 models have a field called order, and I want to use it to order my data.
However I am not able to use order by for this Association.
Updated the code
var SectionQuery = {
include: [{
model: sub_section,
order: [['order', 'asc']],
include: [{
model: question,
order: [['order', 'asc']],
}]
}]
};
return Section.findAll(tehsilQuery);