Does Sequelize.js support raw in attributes/columns?
Any clue about this?
models.OrgTraffic.findAll({
"attributes": ["org_name", "account_id", "account_name", {"raw": "sum(requests)"}], ...})
It seem to work for order by and group by.
http://stackoverflow.com/questions/37173678/raw-in-attributes
Thanks!
Actually, I realized that you can use the literal function. In my case, this one works:
models.OrgTraffic.findAll({
"attributes": ["org_name", "account_id", "account_name", [sequelize.literal('sum(message_count)'), 'mc'], ...})
Most helpful comment
Actually, I realized that you can use the literal function. In my case, this one works: