English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Redis Zrangebylex Command

Redis Sorted Sets (sorted set)

Redis Zrangebylex returns the members of a sorted set within a dictionary range.

Syntax

Basic Syntax of redis Zrange Command:

redis 127.0.0.1:6379> ZRANGEBYLEX key min max [LIMIT offset count]

Available Versions

>= 2.8.9

Return Value

List of elements within a specified range.

Online Examples

redis 127.0.0.1:6379> ZADD myzset 0 a 0 b 0 c 0 d 0 e 0 f 0 g
(integer) 7
redis 127.0.0.1:6379> ZRANGEBYLEX myzset - [c
1) "a"
2) "b"
3) "c"
redis 127.0.0.1:6379> ZRANGEBYLEX myzset - (c
1) "a"
2) "b"
redis 127.0.0.1:6379> ZRANGEBYLEX myzset [aaa (g
1) "b"
2) "c"
3) "d"
4) "e"
5) "f"
redis>

Redis Sorted Sets (sorted set)