Answers for "sequelize count all"

C#
1

sequelize count in include

Location.findAll({
    attributes: { 
        include: [[Sequelize.fn("COUNT", Sequelize.col("sensors.id")), "sensorCount"]] 
    },
    include: [{
        model: Sensor, attributes: []
    }]
});
Posted by: Guest on September-30-2020
0

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.")
})
Posted by: Guest on January-29-2021

C# Answers by Framework

Browse Popular Code Answers by Language