zremrangebyscore
ZREMRANGEBYSCORE
|  Redis Developer Course |  Redis Technical Support |  Redis Enterprise Server | 
|---|
score로 범위를 지정해서 member 삭제
사용법은 zremrangebyscore key min max 이다.
min, max는 score의 범위이다. 모두 삭제하려면 -inf, +inf를 사용한다. +inf의 +는 생략해도 된다.
min, max를 그냥 사용하면 지정한 값을 포함해서 삭제한다.
min, max 값을 제외하려면 앞에 '(' 를 사용한다.
Example
| 명령> | zadd city 50 "New Delhi" 60 "Seoul" 70 "Beijing" 80 "New York" | 
| 결과> | 4 | 
| 명령> | zrangebyscore city -inf inf withscores | 
| 결과> | 0) 50 -> New Delhi 1) 60 -> Seoul 2) 70 -> Beijing 3) 80 -> New York | 
| 명령> | zremrangebyscore city -inf (70 | 
| 결과> | 2 | 
| 명령> | zrangebyscore city -inf inf withscores | 
| 결과> | 0) 70 -> Beijing 1) 80 -> New York | 
| 명령> | zremrangebyscore city -inf 70 | 
| 결과> | 1 | 
| 명령> | zrangebyscore city -inf inf withscores | 
| 결과> | 0) 80 -> New York | 
명령문
ZREMRANGEBYSCORE key min max
- 이 명령은 version 1.2.0 부터 사용할 수 있다.
- 논리적 처리 소요시간은 O(log(N)+M)이다. N은 집합에 속한 member 개수이고, M은 삭제될 member 개수이다.
| 관련 명령 | ZREMRANGEBYSCORE, ZREMRANGEBYLEX, ZREMRANGEBYRANK, SREM, HDEL | 
| Clients for Java | Jedis, Lettuce, Redisson | Clients for C | Hiredis | 
| << ZREMRANGEBYRANK | ZREMRANGEBYSCORE | ZREMRANGEBYLEX >> | 
|---|
	Email
	
	
	답글이 올라오면 이메일로 알려드리겠습니다.
	
 


 
  
			 
			