Answers for "sequalize count"

0

Count Sequelize

MyModel.count({
  include: ...,
  where: ...,
  distinct: true,
  col: 'Product.id'
})
.then(function(count) {
    // count is an integer
});
Posted by: Guest on October-21-2021
0

sequelize findall 2 attributes

Model.findAll({
  attributes: [[sequelize.fn('COUNT', sequelize.col('hats')), 'no_hats']]
});
Posted by: Guest on September-05-2020

Browse Popular Code Answers by Language