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

Node: Fix zrangeWithScores (disallow RangeByLex as it is not supported) #2926

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#### Fixes

* Node: Fix `zrangeWithScores` (disallow `RangeByLex` as it is not supported) ([#2926](https://github.com/valkey-io/valkey-glide/pull/2926))
* Core: improve fix in #2381 ([#2929](https://github.com/valkey-io/valkey-glide/pull/2929))

#### Operational Enhancements
Expand Down
3 changes: 1 addition & 2 deletions node/src/BaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4443,7 +4443,6 @@ export class BaseClient {
* @param key - The key of the sorted set.
* @param rangeQuery - The range query object representing the type of range query to perform.
* - For range queries by index (rank), use {@link RangeByIndex}.
* - For range queries by lexicographical order, use {@link RangeByLex}.
* - For range queries by score, use {@link RangeByScore}.
* @param options - (Optional) Additional parameters:
* - (Optional) `reverse`: if `true`, reverses the sorted set, with index `0` as the element with the highest score.
Expand Down Expand Up @@ -4476,7 +4475,7 @@ export class BaseClient {
*/
public async zrangeWithScores(
key: GlideString,
rangeQuery: RangeByScore | RangeByLex | RangeByIndex,
rangeQuery: RangeByScore | RangeByIndex,
options?: { reverse?: boolean } & DecoderOption,
): Promise<SortedSetDataType> {
return this.createWritePromise<GlideRecord<number>>(
Expand Down
3 changes: 1 addition & 2 deletions node/src/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1989,7 +1989,6 @@ export class BaseTransaction<T extends BaseTransaction<T>> {
* @param key - The key of the sorted set.
* @param rangeQuery - The range query object representing the type of range query to perform.
* - For range queries by index (rank), use {@link RangeByIndex}.
* - For range queries by lexicographical order, use {@link RangeByLex}.
* - For range queries by score, use {@link RangeByScore}.
* @param reverse - If `true`, reverses the sorted set, with index `0` as the element with the highest score.
*
Expand All @@ -1999,7 +1998,7 @@ export class BaseTransaction<T extends BaseTransaction<T>> {
*/
public zrangeWithScores(
key: GlideString,
rangeQuery: RangeByScore | RangeByLex | RangeByIndex,
rangeQuery: RangeByScore | RangeByIndex,
reverse = false,
): T {
return this.addAndReturn(
Expand Down
Loading