dragonfly
dragonfly copied to clipboard
aggregate group by might not work for the snippet below
const sumTest = await redis.ft.aggregate('myindex', `@name:{${name}}`,
{
STEPS: [{
type: AggregateSteps.GROUPBY,
REDUCE: [{
type: AggregateGroupByReducers.SUM,
property: 'foo',
AS: 'total_p'
}]
}]
})
return sumTest?.results[0]?.total_p || 0
it returns 0, even though this property exists.
DF responds with Unknown clause: SUM and Unknown clause: REDUCE