Skip to content

Commit

Permalink
Correction of map representation in RESP2 (#2587)
Browse files Browse the repository at this point in the history
In the protocol spec, the description of how maps are represented in RESP2 is incorrect.

"Maps in RESP2 are represented by arrays, in which each element is a key-value tuple. Each tuple is an array with two elements, these being the key and the value."

This is not true. A map in RESP2 is represented as a flat array containing the keys and values, not nested arrays. The description is updated.

Co-authored-by: Viktor Söderqvist <[email protected]>
  • Loading branch information
heyone-top and zuiderkwast authored Nov 22, 2023
1 parent 4351d16 commit 0728983
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/reference/protocol-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,9 @@ However, low-level programming languages (such as C, for example) will likely re

{{% alert title="Map pattern in RESP2" color="info" %}}
RESP2 doesn't have a map type.
Maps in RESP2 are represented by arrays, in which each element is a key-value tuple.
Each tuple is an array with two elements, these being the key and the value.
A map in RESP2 is represented by a flat array containing the keys and the values.
The first element is a key, followed by the corresponding value, then the next key and so on, like this:
`key1, value1, key2, value2, ...`.
{{% /alert %}}

<a name="set-reply"></a>
Expand Down

0 comments on commit 0728983

Please sign in to comment.