Adding support for CAS/CAD commands. #3837
Merged
+721 −22
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Adding support for new CAS/CAD commands that are part of Redis 8.4 release.
Adding new command: DIGEST
Command definition:
DIGEST keyGet the hash digest of the value stored in key, as a hex string.
Extending SET command to enable the following arguments:
Command definition:
SET key value [NX | XX | IFEQ match-value | IFNE match-value | IFDEQ match-digest | IFDNEmatch-digest] [GET] [EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL]IFEQ match-value - Set the key’s value and expiration only if its current value is equal to match-value. If key doesn’t exist - it won’t be created.
IFNE match-value - Set the key’s value and expiration only if its current value is not equal to match-value. If key doesn’t exist - it will be created.
IFDEQ match-digest - Set the key’s value and expiration only if the digest of its current value is equal to match-digest. If key doesn’t exist - it won’t be created.
IFDNE match-digest - Set the key’s value and expiration only if the digest of its current value is not equal to match-digest. If key doesn’t exist - it will be created.
Adding new command DELEX
Command definition:
DELEX key [IFEQ match-value | IFNE match-value | IFDEQ match-digest | IFDNE match-digest]Conditionally removes the specified key. A key is ignored if it does not exist.
IFEQ match-value - Delete the key only if its value is equal to match-value
IFNE match-value - Delete the key only if its value is not equal to match-value
IFDEQ match-digest - Delete the key only if the digest of its value is equal to match-digest
IFDNE match-digest - Delete the key only if the digest of its value is not equal to match-digest