sequelize findall return code example
Example 1: sequelize get data
Tokens.findAll({
where: { guid: req.query['guid'] }
}).then(tokens => {
console.log(tokens[0]['date'])
}).catch(err => console.log('erro: ' + err));;
Example 2: sequelize findall 2 attributes
Model.findAll({
attributes: [[sequelize.fn('COUNT', sequelize.col('hats')), 'no_hats']]
});