bitop
BITOP
레디스 개발자 교육 신청
|
레디스 정기점검/기술지원Redis Technical Support |
레디스 엔터프라이즈 서버Redis Enterprise Server |
|---|
BIT operation
사용법은 bitop operation destkey key1 key2 이다.
operation은 AND, OR, XOR, NOT이 있다.
src_key는 여러 개 사용할 수 있다.
Example
| 명령> | set key1 A |
| 결과> | OK |
| 명령> | set key2 B |
| 결과> | OK |
| 명령> | bitop AND destkey key1 key2 |
| 결과> | 1 |
| 명령> | get destkey |
| 결과> | @ |
| 명령> | bitop OR destkey key1 key2 |
| 결과> | 1 |
| 명령> | get destkey |
| 결과> | C |
| 명령> | bitop XOR destkey key1 key2 |
| 결과> | 1 |
| 명령> | get destkey |
| 결과> | \x03 redis-cli 표기 |
| 명령> | bitop NOT destkey key1 |
| 결과> | 1 |
| 명령> | get destkey |
| 결과> | \xbe redis-cli 표기 |
명령문
BITOP operation destkey key [key ...]
- 이 명령은 version 2.6.0 부터 사용할 수 있다.
- 논리적 처리 소요시간은 O(N)입니다.
| 관련 명령 | SETBIT, GETBIT, BITCOUNT, BITPOS |
| Clients for Java | Jedis, Lettuce, Redisson | Clients for C | Hiredis |
| << GETBIT | BITOP | BITCOUNT >> |
|---|
Email
답글이 올라오면 이메일로 알려드리겠습니다.
