I would like to create a query that can count the number of records for each day of the month right away in the secelize.js file
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 want to make a query that will return several rows at once, and not how to query the database for this data in 30 queries. Can I do this with transactions?
I will use it for chart purposes, so the best conclusion from this:
[500, 300, 400, 550....]
Thanks for any help!
source share