DEV Community

FatmaMahmoud698
FatmaMahmoud698

Posted on

How can I sort the array as per the array length inside it in sequelize

I want to fetch array that is sorting as per its include length
Category.findAll({
include: [
{
model: db.product,
as: "products",
}
],
})

I want to arrange the array of category as per length of fetched products

Top comments (0)