UCO
0
Q:

sequelize 4 sort on joined table attribute

Customer.findAll({
    order: '"Orders"."orderDate" DESC',
    include: [Order]
}, {
    raw: true
}).then(function(data) {
    console.log(data);
});
// Generated order by clause
// ORDER BY "Orders"."orderDate" DESC;
0

New to Communities?

Join the community