Skip to content

Commit

Permalink
Node: Fix zrangeWithScores (disallow RangeByLex as it is not supp…
Browse files Browse the repository at this point in the history
…orted) (#2926)

Fix `zrangeWithScores`.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
  • Loading branch information
Yury-Fridlyand authored Jan 9, 2025
1 parent 862cba9 commit 4334c54
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
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

0 comments on commit 4334c54

Please sign in to comment.