findall in sequelize with count code example
Example 1: sequelize count all
Project.count().then(c => {
console.log("There are " + c + " projects!")
})
Project.count({ where: {'id': {[Op.gt]: 25}} }).then(c => {
console.log("There are " + c + " projects with an id greater than 25.")
})
Example 2: count using sequelize.fn
exports.getMinPrice = () => Item.findAll({ attributes: [[sequelize.fn('min', sequelize.col('price')), 'minPrice']], });