BITOP

Redis 開発者教育の申込 Redis 定期点検/技術サポート
Redis Technical Support
Redis エンタープライズサーバー
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 返事がかかってなれば、メールでお知らせします。