The documentation for ZRANGE says ZRANGE WITHSCORES returns array interleaves element and score in examples section
|
The following example using `WITHSCORES` shows how the command returns always an array, but this time, populated with *element_1*, *score_1*, *element_2*, *score_2*, ..., *element_N*, *score_N*. |
However, ZRANGE WITHSCORES on RESP3 returns array consists of array with 2 element instead of interleaved array.
This is undocunented differecne between RESP2 and RESP3.
$ redis-cli -3
127.0.0.1:6379> ZADD myzset 1 "one" 2 "two" 3 "three"
(integer) 3
127.0.0.1:6379> ZRANGE myzset 0 1 WITHSCORES
1) 1) "one"
2) (double) 1
2) 1) "two"
2) (double) 2
127.0.0.1:6379>
The "RESP2/RESP3 Reply" section at the bottom of documentation suggests both protocol returns same result so this section should also be updated.
The documentation for ZRANGE says ZRANGE WITHSCORES returns array interleaves element and score in examples section
valkey-doc/commands/zrange.md
Line 119 in 2034f4d
However, ZRANGE WITHSCORES on RESP3 returns array consists of array with 2 element instead of interleaved array.
This is undocunented differecne between RESP2 and RESP3.
The "RESP2/RESP3 Reply" section at the bottom of documentation suggests both protocol returns same result so this section should also be updated.