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
protocols support several different types of reply format for commands.
154
+
118
155
You can find the reply format for a command at the end of its
119
156
reference page in the RESP2/RESP3 Reply section (for example, the
120
157
[`INCRBY`]({{< relref "/commands/incrby" >}}) page shows that the
@@ -132,7 +169,7 @@ use to access the reply value:
132
169
| Constant | Type | Relevant fields of `redisReply`| RESP protocol |
133
170
| :- | :- |:- | :- |
134
171
|`REDIS_REPLY_STATUS`|[Simple string]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) |`reply->str`: the string value (`char*`)<br/> `reply->len`: the string length (`size_t`) | 2, 3 |
135
-
|`REDIS_REPLY_ERROR`|[Simple string]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) |`reply->str`: the string value (`char*`)<br/> `reply->len`: the string length (`size_t`) | 2, 3 |
172
+
|`REDIS_REPLY_ERROR`|[Simple error]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) |`reply->str`: the string value (`char*`)<br/> `reply->len`: the string length (`size_t`) | 2, 3 |
136
173
|`REDIS_REPLY_INTEGER`|[Integer]({{< relref "/develop/reference/protocol-spec#integers" >}}) |`reply->integer`: the integer value (`long long`)| 2, 3 |
137
174
|`REDIS_REPLY_NIL`|[Null]({{< relref "/develop/reference/protocol-spec#nulls" >}}) | No data | 2, 3 |
138
175
|`REDIS_REPLY_STRING`|[Bulk string]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) |`reply->str`: the string value (`char*`)<br/> `reply->len`: the string length (`size_t`) | 2, 3 |
@@ -144,3 +181,218 @@ use to access the reply value:
144
181
|`REDIS_REPLY_PUSH`|[Push]({{< relref "/develop/reference/protocol-spec#pushes" >}}) |`reply->elements`: number of elements (`size_t`)<br/> `reply->element`: array elements (`redisReply`) | 3 |
145
182
|`REDIS_REPLY_BIGNUM`|[Big number]({{< relref "/develop/reference/protocol-spec#big-numbers" >}}) |`reply->str`: number value as string (`char*`)<br/> `reply->len`: the string length (`size_t`) | 3 |
146
183
|`REDIS_REPLY_VERB`|[Verbatim string]({{< relref "/develop/reference/protocol-spec#verbatim-strings" >}}) |`reply->str`: the string value (`char*`)<br/> `reply->len`: the string length (`size_t`)<br/> `reply->vtype`: content type (`char[3]`) | 3 |
184
+
185
+
### Reply format processing examples
186
+
187
+
#### Integers
188
+
189
+
The `REDIS_REPLY_INTEGER` and `REDIS_REPLY_BOOL` reply types both
190
+
contain values in `reply->integer`. However, `REDIS_REPLY_BOOL` is
191
+
rarely used. Even when the command essentially returns a boolean value,
0 commit comments