ZRANGESTORE

ZRANGESTORE

ZRANGESTORE dst src min max [BYSCORE | BYLEX] [REV] [LIMIT]
Available since
6.2.0
Time complexity
O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements stored into the destination key.
ACL categories
@write, @sortedset, @slow

This command is like ZRANGE, but stores the result in the <dst> destination key.

Examples #

ZADD srczset 1 "one" 2 "two" 3 "three" 4 "four"
ZRANGESTORE dstzset srczset 2 -1
ZRANGE dstzset 0 -1

Redict logo courtesy of @janWilejan, CC-BY-SA-4.0. Download SVG ⤑

Portions of this website courtesy of Salvatore Sanfilippo, CC-BY-SA-4.0.