Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

sequelize findall 2 attributes

Model.findAll({
  attributes: [[sequelize.fn('COUNT', sequelize.col('hats')), 'no_hats']]
});
Source by sequelize.readthedocs.io #
 
PREVIOUS NEXT
Tagged: #sequelize #findall #attributes
ADD COMMENT
Topic
Name
6+6 =