-
Notifications
You must be signed in to change notification settings - Fork 0
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 Decr and DecrBy. (String Commands) #80
Added Decr and DecrBy. (String Commands) #80
Conversation
@@ -48,4 +48,31 @@ public interface StringCommands { | |||
* is set, return the old value as a <code>String</code>. | |||
*/ | |||
CompletableFuture<String> set(String key, String value, SetOptions options); | |||
|
|||
/** | |||
* Increment the string representing a floating point number stored at <code>key</code> by <code> |
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.
I think this is the comment for incr
. But decr
should say "Decrements".
Also, this command doesn't take an amount
. We should follow what's in the node side, since they have overloaded this function like we have.
/** Decrements the number stored at `key` by one. If `key` does not exist, it is set to 0 before performing the operation.
* See https://redis.io/commands/decr/ for details.
*
* @param key - The key to decrement its value.
* @returns the value of `key` after the decrement. An error is raised if `key` contains a value
* of the wrong type or contains a string that can not be represented as integer.
*/
public decr(key: string): Promise<number> {
return this.createWritePromise(createDecr(key));
}
/** Decrements the number stored at `key` by `amount`. If `key` does not exist, it is set to 0 before performing the operation.
* See https://redis.io/commands/decrby/ for details.
*
* @param key - The key to decrement its value.
* @param amount - The amount to decrement.
* @returns the value of `key` after the decrement. An error is raised if `key` contains a value
* of the wrong type or contains a string that can not be represented as integer.
*/
public decrBy(key: string, amount: number): Promise<number> {
return this.createWritePromise(createDecrBy(key, amount));
}
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.
I'll fix the documentation. I don't understand the rest of your comment decr just has 1 argument and that's the key what are you referring to? DecrBy has amount.
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.
The documentation used to mention "amount" for the overloaded method without "amount". All fixed now. You're good.
3511994
to
2d53c0d
Compare
1dedddf
into
java/integ_SanH_add_Decr_DecrBy
…g Commands) (valkey-io#957) * Added Decr and DecrBy to BaseClient and BaseTransaction.(String Commands) (#80) * Minor fix for documentation. * Added Transaction Unit Tests. * Minor documentation refactor * Removed the message of error in documentation for Decr commands and Added transaction tests.
No description provided.