Using built-in SQL functions with SequelizeJS
1 answer
Since there was no answer, but someone took my question down, I am posting the answer I found myself:
The solution is to use the Sequelize.literal () function . For example, in the question, the answer is:
options = {};
options.attributes = ['id', sequelize.literal('(NOW() - timestamp) as recordAge')];
MyTable.find(options).success(success);
+2
source to share