fix(search): allow LOAD * in FT.AGGREGATE #2726#3241
Merged
nkaradzhov merged 1 commit intoredis:masterfrom Apr 22, 2026
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 095ae1c. Configure here.
| if (options?.TIMEOUT !== undefined) { | ||
| parser.pushVariadicWithLength(args); | ||
| } | ||
| } if (options?.TIMEOUT !== undefined) { |
There was a problem hiding this comment.
Missing newline causes } if on same line
Low Severity
The closing brace of the LOAD block and the TIMEOUT if statement are on the same line (} if (), making it visually ambiguous whether this is an independent if or was intended to be an else if. The original code had these as clearly separated independent if blocks with a blank line between them. A future maintainer could easily mistake this for a missing else and introduce a regression.
Reviewed by Cursor Bugbot for commit 095ae1c. Configure here.
nkaradzhov
approved these changes
Apr 22, 2026
Collaborator
nkaradzhov
left a comment
There was a problem hiding this comment.
@watersRand Thanks, this looks good!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
This pull request adds support for the
LOAD *syntax within theFT.AGGREGATEcommand.Purpose:
According to the [RediSearch documentation](https://redis.io/commands/ft.aggregate/), the
LOADclause typically expects a specific number of arguments (nargs). However, it also supports a wildcard*to project all document attributes into the aggregation pipeline.Problem:
The previous implementation utilized
pushVariadicWithLength, which automatically prepended a numeric count to the arguments. When passing*, the library generatedLOAD 1 *, resulting in a Redis protocol error.Solution:
The
parseAggregateOptionsfunction now includes type narrowing to handle the wildcard case:LOADis exactly'*', the parser pushes the literal string*as the argument count substitute.pushVariadicWithLengthlogic is maintained to ensure backward compatibility.Checklist
npm testpass with this change (including linting)?Note
Medium Risk
Changes
FT.AGGREGATEargument construction to special-caseLOAD, which can affect query serialization and compatibility with RediSearch. While covered by a new unit test, this touches core command parsing logic used broadly by clients.Overview
Adds
LOAD *support forFT.AGGREGATE.FtAggregateOptions.LOADnow accepts the wildcard'*', andparseAggregateOptionsemitsLOAD *directly instead ofLOAD 1 *(while keeping the existing counted-args behavior for specific fields/aliases and arrays).Updates tests to cover the new wildcard projection case.
Reviewed by Cursor Bugbot for commit 095ae1c. Bugbot is set up for automated code reviews on this repo. Configure here.