I'd like to create query which is able to count number of records for every day in month at once in sequelize.js Not like :
Record.count({ where: { createdAt: { $like: '2015-04-14%' } } }).then(function(c) {
console.log("2015-04-14 have been created" + c + "records");
});
Record.count({ where: { createdAt: { $like: '2015-04-15%' } } }).then(function(c) {
console.log("2015-04-15 have been created" + c + "records");
});
Record.count({ where: { createdAt: { $like: '2015-04-16%' } } }).then(function(c) {
console.log("2015-04-16 have been created" + c + "records");
});
....
....
I wanna make query which will returns number of rows at once, not like ask database for this data in 30 queries. It is possible make it with transactions?
I'll use it for chart purposes, so best output from this is like:
[500, 300, 400, 550....]
Thanks for any help!