From 4334c5480e58157cdca3b04cb5119db8ab79b99f Mon Sep 17 00:00:00 2001 From: Yury-Fridlyand Date: Thu, 9 Jan 2025 10:28:30 -0800 Subject: [PATCH] Node: Fix `zrangeWithScores` (disallow `RangeByLex` as it is not supported) (#2926) Fix `zrangeWithScores`. Signed-off-by: Yury-Fridlyand --- CHANGELOG.md | 1 + node/src/BaseClient.ts | 3 +-- node/src/Transaction.ts | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75da3edd3a..2f5cf14315 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/node/src/BaseClient.ts b/node/src/BaseClient.ts index a9aed75560..ac3de2be06 100644 --- a/node/src/BaseClient.ts +++ b/node/src/BaseClient.ts @@ -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. @@ -4476,7 +4475,7 @@ export class BaseClient { */ public async zrangeWithScores( key: GlideString, - rangeQuery: RangeByScore | RangeByLex | RangeByIndex, + rangeQuery: RangeByScore | RangeByIndex, options?: { reverse?: boolean } & DecoderOption, ): Promise { return this.createWritePromise>( diff --git a/node/src/Transaction.ts b/node/src/Transaction.ts index bdccbe151f..39efcaf8f6 100644 --- a/node/src/Transaction.ts +++ b/node/src/Transaction.ts @@ -1989,7 +1989,6 @@ export class BaseTransaction> { * @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. * @@ -1999,7 +1998,7 @@ export class BaseTransaction> { */ public zrangeWithScores( key: GlideString, - rangeQuery: RangeByScore | RangeByLex | RangeByIndex, + rangeQuery: RangeByScore | RangeByIndex, reverse = false, ): T { return this.addAndReturn(