Answers for "sequelize count fn"

1

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
3

count using sequelize.fn

exports.getMinPrice = () => Item.findAll({    attributes: [[sequelize.fn('min', sequelize.col('price')), 'minPrice']],  });
Posted by: Guest on May-30-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language