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

Added zremRangeByScore command in Node. #926

Merged
merged 2 commits into from
Mar 13, 2024

Conversation

adanWattad
Copy link
Contributor

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@adanWattad adanWattad requested a review from a team as a code owner February 8, 2024 13:31
@adanWattad adanWattad force-pushed the node/zrembyscore branch 5 times, most recently from 2618966 to 85cd403 Compare February 21, 2024 09:06
@adanWattad adanWattad force-pushed the node/zrembyscore branch 4 times, most recently from ec7b644 to c5bffdf Compare March 6, 2024 14:03
@@ -1171,6 +1172,24 @@ export class BaseClient {
return this.createWritePromise(createPttl(key));
}

/** Removes all elements in the sorted set stored at `key` with a score between `minScore` and `maxScore` (inclusive).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should remove the '(inclusive)' - as it depends on the ScoreLimit

): redis_request.Command {
const args = [key];

if (minScore == "positiveInfinity") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is a duplication of createZcount. Lets move it to a separate function (something like getScoreLimitArg)

@@ -936,6 +937,25 @@ export class BaseTransaction<T extends BaseTransaction<T>> {
return this.addAndReturn(createPttl(key));
}

/** Removes all elements in the sorted set stored at `key` with a score between `minScore` and `maxScore` (inclusive).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same re. (inclusive).

@adanWattad adanWattad force-pushed the node/zrembyscore branch 3 times, most recently from 250e203 to 284badc Compare March 7, 2024 13:34
@adanWattad
Copy link
Contributor Author

@barshaul ready

if (score == "positiveInfinity") {
return positiveInfinityArg;
} else if (score == "negativeInfinity") {
return negativeInfinityArg;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have this function I don't see why we need to have the negativeInfinityArg , positiveInfinityArg and isInclusiveArg consts. We don't use them anywhere else, right?

Copy link
Collaborator

@barshaul barshaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the redundant consts if we use them only in the score limit function & merge

@adanWattad adanWattad merged commit 4a208f1 into valkey-io:main Mar 13, 2024
45 checks passed
@adanWattad adanWattad deleted the node/zrembyscore branch March 13, 2024 11:28
Sa1Gur pushed a commit to Sa1Gur/glide-for-redis that referenced this pull request Mar 18, 2024
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants