dragonflydb / dragonfly

A modern replacement for Redis and Memcached
https://www.dragonflydb.io/
Other
25.69k stars 946 forks source link

aggregate group by might not work for the snippet below #3492

Closed romange closed 1 month ago

romange commented 2 months ago
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.

romange commented 2 months ago

DF responds with Unknown clause: SUM and Unknown clause: REDUCE