zrevrangebylex
ZREVRANGEBYLEX
|  Redis Developer Course |  Redis Technical Support |  Redis Enterprise Server | 
|---|
member로 범위를 지정해서 역순(큰 것부터) 조회
사용법은 zrevrangebylex key max min 이다.
max, min 는 member의 범위이다. 모두 조회하려면 +, -를 사용한다.
max, min 에 값을 줄 경우 반드시 앞에 [ 또는 ( 를 사용해야 한다.
[ 는 값을 포함할 때 사용하고, ( 는 제외할 때 사용한다.
이 명령은 score가 모두 같아야 원하는 결과를 얻을 수 있다.
이 명령에는 withscores 옵션이 없다.
Example
| 명령> | zrevrangebylex city + - | 
| 결과> | 0) Seoul 1) New York 2) New Delhi 3) Beijing | 
| 명령> | zrevrangebylex city + "[New Delhi" | 
| 결과> | 0) Seoul 1) New York 2) New Delhi | 
| 명령> | zrevrangebylex city "(Seoul" "[New Delhi" | 
| 결과> | 0) New York 1) New Delhi | 
| 명령> | zrevrangebylex city "(Seoul" "(New Delhi" | 
| 결과> | 0) New York | 
limit offset count 사용
사용법은 zrevrangebylex key max minlimit offset count 이다.
offset은 시작점을 나타내고, count는 조회할 member의 개수이다.
offset은 0부터 시작할 수 있고, count가 1 이상이여야 한다. 0 이면 조회되지 않는다.
limit가 있으면 offset count 모두 있어야 한다.
page 별 조회에 유용하게 사용할 수 있다.<
Example
| 명령> | zrevrangebylex city + -limit 0 2 | 
| 결과> | 0) Seoul 1) New York | 
| 명령> | zrevrangebylex city - + limit 2 2 | 
| 결과> | 0) New Delhi 1) Beijing | 
명령문
ZREVRANGEBYLEX key max min [limit offset count]
- 이 명령은 version 2.8.9 부터 사용할 수 있습니다.
- 논리적 처리 소요시간은 O(log(N)+M)이다. N은 집합에 속한 member 개수이고, M은 삭제될 member 개수입니다.
| 관련 명령 | ZRANGE, ZREVRANGE, ZREVRANGEBYSCORE, LRANGE | 
| Clients for Java | Jedis, Lettuce, Redisson | Clients for C | Hiredis | 
| << ZRANGEBYLEX | ZREVRANGEBYLEX | ZCARD >> | 
|---|
	Email
	
	
	답글이 올라오면 이메일로 알려드리겠습니다.
	
 


 
  
			 
			