R64.CONTAINS
| Category | Description |
|---|---|
| Syntax | R64.CONTAINS key1 key2 [ALL, ALL_STRICT, EQ] |
| Time complexity | O(C) |
| Supports structures | Bitmap64 |
| Command description | Check whether two bitmaps intersect. |
Parameter
- key1: The name of the Roaring bitmap key.
- key2: The name of the Roaring bitmap key.
- ALL: If this parameter is specified, returns 1 when all the elements of key2 are also in key1.
- ALL_STRICT: If this parameter is specified, returns 1 when all the elements of key2 are also in key1, and key2 is strictly less than key1.
- EQ: If this parameter is specified, returns 1 when the two bitmaps contain the same elements.
Output
- If the operation is successful:
- If key1 contains key2, a value of
1is returned. - If key1 does not contain key2, a value of
0is returned.
- If key1 contains key2, a value of
- Otherwise, an error message is returned.
Examples
Basic Usage
bash
$ redis-cli
127.0.0.1:6379> R64.SETINTARRAY foo1 1 2 3
OK
127.0.0.1:6379> R64.SETINTARRAY foo2 2 3 4
OK
# 2 3 existed in key1
R64.CONTAINS foo1 foo2
(integer) 1
# 4 missed in key1
R64.CONTAINS foo1 foo2 ALL
(integer) 0