Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FT.AGGREGATE _ LOAD * is not supported #2726

Open
ivan-kleshnin opened this issue Mar 29, 2024 · 0 comments
Open

FT.AGGREGATE _ LOAD * is not supported #2726

ivan-kleshnin opened this issue Mar 29, 2024 · 0 comments
Labels

Comments

@ivan-kleshnin
Copy link

ivan-kleshnin commented Mar 29, 2024

Description

I'm not sure if it counts as a bug or a half-implemented feature...

https://redis.io/commands/ft.aggregate/
If * is used as nargs, all attributes in a document are loaded.

I assume it is not supported – couldn't find any mention in issues or elsewhere.

Example: FT.AGGREGATE idx:user * LOAD * should return all fields of all indexed "user" documents.

await client.aggregate(`idx:user`, "*", {
  LOAD: "*", // causes TS error, does not work as JS as well
  // TS2345: Argument of type [string, string, {LOAD: "*";}] is not assignable to parameter of type
})

It seems Node-Redis supports only basic named fields like LOAD: "@email". It does not support load all functionality which is IMO necessary, for example, to implement cursor-based pagination.

await client.aggregate(`idx:user`, "*", {
  LOAD: "@email", 
}) // works fine

Node.js Version

21.7.1

Redis Server Version

7.2.4

Node Redis Version

7.2.4

Platform

macOS

Logs

No response


Update

As a temporary low-level solution it's possible to:

await client.sendCommand(["FT.AGGREGATE", "idx:user", "*", "LOAD", "*"])

Requires manual reply, manual JSON parsing, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant