BITOP
Performs bitwise operations between multiple bitmaps and stores the result in a destination key.
Syntax
BITOP operation destkey key [key ...]
Parameters
- operation: The bitwise operation to perform. Options are:
AND
: Bitwise ANDOR
: Bitwise ORXOR
: Bitwise XORNOT
: Bitwise NOT (unary operation)
- destkey: The key where the result of the bitwise operation will be stored.
- key: One or more keys to perform the bitwise operation on. These are the source bitmaps.
Details
- Available since: 2.6.0
- Time complexity: O(N) where N is the size of the bitmaps.
- ACL categories:
@write
,@bitmap
,@slow
The BITOP
command performs bitwise operations on one or more bitmaps and stores the result in a new key. It supports several bitwise operations including AND, OR, XOR, and NOT. The command operates on byte-level granularity and the result will be of the same length as the longest input bitmap.