Answers for "count on field value and group by in sequelize"

0

count on field value and group by in sequelize

return Model.findAll({
    group: [ '"Model".id' ],
    attributes: ['id', [Sequelize.fn('count', Sequelize.col('"Likes".id')), 'likes_count']],
    include: [{ attributes:sssss [], model: Like }],
});
Posted by: Guest on October-07-2021

Browse Popular Code Answers by Language