BF.CARD
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).
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| Filter exists | Integer: items added | Integer |
| Key does not exist | Integer 0 |
Integer 0 |
WRONGTYPE if the key holds another type.
Examples
Section titled “Examples”127.0.0.1:6379> BF.MADD visitors alice bob alice1) (integer) 12) (integer) 13) (integer) 0127.0.0.1:6379> BF.CARD visitors(integer) 2127.0.0.1:6379> BF.CARD nosuchfilter(integer) 0Compatibility
Section titled “Compatibility”Same as BF.CARD in RedisBloom.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.