-
Notifications
You must be signed in to change notification settings - Fork 65
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
Conversation
2618966
to
85cd403
Compare
ec7b644
to
c5bffdf
Compare
node/src/BaseClient.ts
Outdated
@@ -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). |
There was a problem hiding this comment.
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
node/src/Commands.ts
Outdated
): redis_request.Command { | ||
const args = [key]; | ||
|
||
if (minScore == "positiveInfinity") { |
There was a problem hiding this comment.
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)
node/src/Transaction.ts
Outdated
@@ -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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same re. (inclusive).
250e203
to
284badc
Compare
@barshaul ready |
node/src/Commands.ts
Outdated
if (score == "positiveInfinity") { | ||
return positiveInfinityArg; | ||
} else if (score == "negativeInfinity") { | ||
return negativeInfinityArg; |
There was a problem hiding this comment.
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?
There was a problem hiding this 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
1bc8112
to
e26fc63
Compare
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.