Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

BF.CARD

Last updated
BF.CARD key
Group
Bloom filter
Complexity
O(1)
Arity
-1 (at least 1 words, counting the command name)
Flags
none
Keys
first 1, last 1, step 1
HotKV Cloud
All plans
On-Premise
no license needed

BF.CARD returns how many items have been added to the Bloom filter at key. Only adds that reported the item as new are counted, so an item added twice counts once (and a new item wrongly reported as present is not counted).

Case RESP2 RESP3
Filter exists Integer: items added Integer
Key does not exist Integer 0 Integer 0

WRONGTYPE if the key holds another type.

127.0.0.1:6379> BF.MADD visitors alice bob alice
1) (integer) 1
2) (integer) 1
3) (integer) 0
127.0.0.1:6379> BF.CARD visitors
(integer) 2
127.0.0.1:6379> BF.CARD nosuchfilter
(integer) 0

Same as BF.CARD in RedisBloom.

BF.INFO, BF.ADD