-
Notifications
You must be signed in to change notification settings - Fork 27
Add documentation for DIGEST and DELEX commands #511
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: romange <3674760+romange@users.noreply.github.com>
|
|
||
| `DELEX` extends [`DEL`](./del.md) by adding conditional deletion based on value or digest matching. Without conditions, `DELEX key` behaves identically to `DEL key`. | ||
|
|
||
| ### Is DELEX compatible with Redis? |
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 Redis compatibility questions.
- verify DIGEST output on your examples by running
ghcr.io/dragonflydb/dragonfly-dev:ubuntuand checking the output against this container that supports DIGEST and DELEX commands. - align the examples to have correct digest strings
- Mention for both commands that they are available for Dragonfly v1.37.0 or later
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.
Done in commit dca7180:
- ✅ Removed Redis compatibility questions from both documents
- ✅ Verified all DIGEST outputs using
ghcr.io/dragonflydb/dragonfly-dev:ubuntucontainer and updated examples with correct values - ✅ Aligned all examples with actual digest strings (e.g., "test" → "9ec9f7918d7dfc40", "hello" → "9555e8555c62dcfd", etc.)
- ✅ Added "Availability: Dragonfly v1.37.0 and later" to both command documents
All digest values have been verified against the dev container and are now accurate.
Co-authored-by: romange <3674760+romange@users.noreply.github.com>
|
|
||
| ### Can DIGEST work with compressed or integer-encoded strings? | ||
|
|
||
| Yes, `DIGEST` handles all string encodings including raw strings, integer-encoded strings, and compressed strings. |
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.
@copilot remove compressed mention as there are no compression of strings in Dragonfly
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.
Done in commit 6e8daf3. Removed all mentions of "compressed" strings from the DIGEST documentation. The FAQ now reads:
"Can DIGEST work with integer-encoded strings?"
"Yes, DIGEST handles all string encodings including raw strings and integer-encoded strings."
Co-authored-by: romange <3674760+romange@users.noreply.github.com>
vyavdoshenko
left a comment
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.
lgtm
Documentation for DIGEST and DELEX Commands
docs/command-reference/strings/digest.mddocs/command-reference/generic/delex.mddocs/command-reference/compatibility.mdto include both commandssrc/components/CompatibilityTable/data.jsonto include both commandsSummary
This PR adds comprehensive documentation for the new
DIGESTandDELEXcommands introduced in dragonflydb/dragonfly#6328. Both commands are available in Dragonfly v1.37.0 and later.DIGEST Command
docs/command-reference/strings/digest.mdDELEX Command
docs/command-reference/generic/delex.mdRecent Changes
Validation
✅ Documentation site builds successfully with
yarn build✅ All digest values verified against actual Dragonfly dev container
✅ Redis compatibility questions removed
✅ Version availability information added
✅ Accurate information about string encoding support
Original prompt
Add Documentation for DELEX and DIGEST Commands
Overview
Add documentation pages for the new
DELEXandDIGESTcommands that were implemented in dragonflydb/dragonfly#6328. These commands are Redis 8.4.0 compatible and enable atomic conditional string operations.Commands to Document
1. DIGEST Command
Location: Create
docs/command-reference/strings/digest.mdCommand Details:
DIGEST keynilif the key does not existWRONGTYPEerror if the key exists but is not a string typeExample Content Structure (follow pattern from
docs/command-reference/strings/get.md):Time complexity: O(N) where N is the length of the string value
ACL categories: @READ, @string, @fast
Parameter Explanations
key: The key whose value should be hashed. Must be a string type.Return Values
nilif the key does not exist.Code Examples
Basic Example
Compute digest of a string value:
Non-Existent Key
If the key does not exist,
DIGESTreturnsnil:dragonfly$> DIGEST non_existent_key (nil)Digest Consistency
The same value always produces the same digest:
Different Values Produce Different Digests
Error on Wrong Type
Best Practices
DIGESTto compare values efficiently without transferring full content over the network.DELEX IFDEQ/IFDNEfor conditional deletions based on digest matching.Common Mistakes
DIGESTon non-string keys will result in aWRONGTYPEerror.FAQs
What hashing algorithm does DIGEST use?
DIGESTuses the XXH3 algorithm, which is a fast, non-cryptographic hash function that produces a 64-bit hash value.Is DIGEST suitable for cryptographic purposes?
No,
DIGESTuses XXH3 which is not a cryptographic hash function. For cryptographic purposes, use dedicated cryptographic hash functions.Can DIGEST work with compressed or integer-encoded strings?
Yes,
DIGESThandles all string encodings including raw strings, integer-encoded strings, and compressed strings.Is DIGEST compatible with Redis?
Yes,
DIGESTis compatible with Redis 8.4.0 and later versions.