Ejemplo 1: sequelize.fn
// Counting number of totalPrice from column itemPrice table
Model.findAll({
attributes: {
include: [
[sequelize.fn('COUNT', sequelize.col('itemPrice')), 'totalPrice']
]
}
});
Ejemplo 2: sequelize.fn
// for gettting all username in uppercase
instance.update({
username: sequelize.fn('upper', sequelize.col('username'))
});
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)