I want to use array_agg() function with sequelize. How can I do that ?
I have been used below code, but it doesn't work.
let statusTabs = await Parameters.findAll({
where: {
param_key: 't_status',
param_name: ['Washing', 'Awaiting', 'Pending']
},
attributes: [
sequelize.literal('array_agg(param_key)'),
sequelize.fn('array_agg', sequelize.col('param_key'))
]
});
It is giving errors like below -
TypeError: Cannot read property 'fn' of undefined
TypeError: Cannot read property 'literal' of undefined
How can I get array_agg() to work ?
question from:
https://stackoverflow.com/questions/65935841/how-to-use-array-agg-in-sequelize 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…