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 ?