Skip to content

R.CONTAINS / R64.CONTAINS ​

Tests the set relationship between two bitmaps.

SyntaxR.CONTAINS key1 key2 [mode]
64-bitR64.CONTAINS key1 key2 [mode]
Time complexityO(N)

Arguments ​

  • key1, key2 — both keys must exist
  • mode — optional: ALL (key2 ⊆ key1), ALL_STRICT (proper subset), EQ (equal). Without a mode: any overlap.

Reply ​

Integer 0 or 1.

Notes ​

  • The default overlap check has no token — an explicit NONE argument is rejected.
  • Modes are case-sensitive (all is rejected), and the error names the argument as given: ERR invalid mode argument: all.

Example ​

bash
127.0.0.1:6379> R.CONTAINS segment:a segment:b
(integer) 1
127.0.0.1:6379> R.CONTAINS segment:a segment:b ALL
(integer) 0