You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/commands/delex.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,14 +74,15 @@ Conditionally removes the specified key based on value or digest comparison.
74
74
75
75
## Options
76
76
77
-
The DELEX command supports a set of options that modify its behavior:
77
+
The DELEX command supports a set of options that modify its behavior.
78
+
Only one of the options can be specified.
78
79
79
-
*`IFEQ value` -- Remove the key if the value is equal to the specified value.
80
-
*`IFNE value` -- Remove the key if the value is not equal to the specified value.
81
-
*`IFDEQ digest` -- Remove the key if the digest is equal to the specified digest.
82
-
*`IFDNE digest` -- Remove the key if the digest is not equal to the specified digest.
80
+
*`IFEQ ifeq-value` -- Remove the key if the value is equal to the specified value.
81
+
*`IFNE ifne-value` -- Remove the key if the value is not equal to the specified value.
82
+
*`IFDEQ ifeq-digest` -- Remove the key if the digest is equal to the specified digest.
83
+
*`IFDNE ifne-digest` -- Remove the key if the digest is not equal to the specified digest.
83
84
84
-
In 8.4, keys must be of type string.
85
+
In 8.4, keys must be of type string when using one of the options above. If no options are specified, the key is removed regardless of its type.
85
86
86
87
## Return information
87
88
@@ -90,12 +91,13 @@ In 8.4, keys must be of type string.
90
91
tab2="RESP3" >}}
91
92
92
93
One of the following:
93
-
-[Error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) if key exists but holds a value that is not a string and `IFEQ/IFNE/IFDEQ/IFDNE` is specified.
94
94
-[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): 0 if not deleted (the key does not exist or a specified `IFEQ/IFNE/IFDEQ/IFDNE` condition is false), or 1 if deleted.
95
+
-[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) if the key exists but holds a value that is not a string and one of `IFEQ, IFNE, IFDEQ,` or `IFDNE` is specified.
95
96
96
97
-tab-sep-
97
98
98
-
TODO: Add RESP3 return information
99
+
One of the following:
100
+
-[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): 0 if not deleted (the key does not exist or a specified `IFEQ/IFNE/IFDEQ/IFDNE` condition is false), or 1 if deleted.
101
+
-[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) if the key exists but holds a value that is not a string and one of `IFEQ, IFNE, IFDEQ,` or `IFDNE` is specified.
Copy file name to clipboardExpand all lines: content/commands/digest.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,32 +41,32 @@ key_specs:
41
41
type: range
42
42
linkTitle: DIGEST
43
43
since: 8.4.0
44
-
summary: Returns the XXH3 hash of a string value.
44
+
summary: Returns the XXH3 hash of a string value as a hexadecimal string.
45
45
syntax_fmt: DIGEST key
46
46
syntax_str: ''
47
47
title: DIGEST
48
48
---
49
-
Returns the XXH3 hash of a string value.
50
49
51
-
## Required arguments
52
-
53
-
<detailsopen><summary><code>key</code></summary>
54
-
55
-
TODO: Add description for key (key)
56
-
57
-
</details>
50
+
Get the XXH3 hash digest for the value stored in the specified key as a hexadecimal string. Keys must be of type string.
58
51
59
52
## Return information
60
53
61
54
{{< multitabs id="return-info"
62
55
tab1="RESP2"
63
56
tab2="RESP3" >}}
64
57
65
-
TODO: Add RESP2 return information
58
+
One of the following:
59
+
60
+
-[Null bulk string reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) if the key does not exist.
61
+
-[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) if the key exists but holds a value which is not a string.
62
+
-[Bulk string reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) the XXH3 digest of the value stored in the key as a hexadecimal string.
66
63
67
64
-tab-sep-
68
65
69
-
TODO: Add RESP3 return information
66
+
One of the following:
70
67
71
-
{{< /multitabs >}}
68
+
-[Null bulk string reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) if the key does not exist.
69
+
-[Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) if the key exists but holds a value which is not a string.
70
+
-[Bulk string reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) the XXH3 digest of the value stored in the key as a hexadecimal string.
If `key` already holds a value, it is overwritten, regardless of its type.
118
143
Any previous time to live associated with the key is discarded on successful `SET` operation.
@@ -127,6 +152,10 @@ The `SET` command supports a set of options that modify its behavior:
127
152
*`PXAT`*timestamp-milliseconds* -- Set the specified Unix time at which the key will expire, in milliseconds (a positive integer).
128
153
*`NX` -- Only set the key if it does not already exist.
129
154
*`XX` -- Only set the key if it already exists.
155
+
*`IFEQ ifeq-value` -- Set the key’s value and expiration only if its current value is equal to `ifeq-value`. If the key doesn’t exist, it won’t be created.
156
+
*`IFNE ifne-value` -- Set the key’s value and expiration only if its current value is not equal to `ifne-value`. If the key doesn’t exist, it will be created.
157
+
*`IFDEQ ifeq-digest` -- Set the key’s value and expiration only if the digest of its current value is equal to `ifeq-digest`. If the key doesn’t exist, it won’t be created.
158
+
*`IFDNE ifne-digest` -- Set the key’s value and expiration only if the digest of its current value is not equal to `ifne-digest`. If the key doesn’t exist, it will be created.
130
159
*`KEEPTTL` -- Retain the time to live associated with the key.
131
160
*`GET` -- Return the old string stored at key, or nil if key did not exist. An error is returned and `SET` aborted if the value stored at key is not a string.
132
161
@@ -180,20 +209,24 @@ The script should be called with `EVAL ...script... 1 resource-name token-value`
180
209
tab1="RESP2"
181
210
tab2="RESP3" >}}
182
211
183
-
* If `GET` was not specified, any of the following:
184
-
*[Nil reply](../../develop/reference/protocol-spec#bulk-strings): Operation was aborted (conflict with one of the `XX`/`NX` options). The key was not set.
212
+
* If `GET` was not specified, one of the following:
213
+
*[Null bulk string reply](../../develop/reference/protocol-spec#bulk-strings) in the following two cases.
214
+
* The key doesn’t exist and `XX/IFEQ/IFDEQ` was specified. The key was not created.
215
+
* The key exists, and `NX` was specified or a specified `IFEQ/IFNE/IFDEQ/IFDNE` condition is false. The key was not set.
185
216
*[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`: The key was set.
186
-
* If `GET` was specified, any of the following:
187
-
*[Nil reply](../../develop/reference/protocol-spec#bulk-strings): The key didn't exist before the `SET`. If `XX` was specified, the key was not set. Otherwise, the key was set.
188
-
*[Bulk string reply](../../develop/reference/protocol-spec#bulk-strings): The previous value of the key. If `NX` was specified, the key was not set. Otherwise, the key was set.
217
+
* If `GET` was specified, one of the following:
218
+
*[Null bulk string reply](../../develop/reference/protocol-spec#bulk-strings): The key didn't exist before the `SET` operation, whether the key was created of not.
219
+
*[Bulk string reply](../../develop/reference/protocol-spec#bulk-strings): The previous value of the key, whether the key was set or not.
189
220
190
221
-tab-sep-
191
222
192
-
* If `GET` was not specified, any of the following:
193
-
*[Null reply](../../develop/reference/protocol-spec#nulls): Operation was aborted (conflict with one of the `XX`/`NX` options). The key was not set.
223
+
* If `GET` was not specified, one of the following:
224
+
*[Null reply](../../develop/reference/protocol-spec#nulls) in the following two cases.
225
+
* The key doesn’t exist and `XX/IFEQ/IFDEQ` was specified. The key was not created.
226
+
* The key exists, and `NX` was specified or a specified `IFEQ/IFNE/IFDEQ/IFDNE` condition is false. The key was not set.
194
227
*[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`: The key was set.
195
-
* If `GET` was specified, any of the following:
196
-
*[Null reply](../../develop/reference/protocol-spec#nulls): The key didn't exist before the `SET`. If `XX` was specified, the key was not set. Otherwise, the key was set.
197
-
*[Bulk string reply](../../develop/reference/protocol-spec#bulk-strings): The previous value of the key. If `NX` was specified, the key was not set. Otherwise, the key was set.
228
+
* If `GET` was specified, one of the following:
229
+
*[Null reply](../../develop/reference/protocol-spec#nulls): The key didn't exist before the `SET` operation, whether the key was created of not.
230
+
*[Bulk string reply](../../develop/reference/protocol-spec#bulk-strings): The previous value of the key, whether the key was set or not.
0 commit comments