BF.CARD

Usage:
BF.CARD key
Complexity:
O(1)
Module:
valkey-bloom
Since module version:
1.0.0

Returns the cardinality of a bloom filter which is the number of items that have been successfully added to it.

Examples

127.0.0.1:6379> BF.ADD key val
(integer) 1
127.0.0.1:6379> BF.CARD key
(integer) 1
127.0.0.1:6379> BF.CARD nonexistentkey
(integer) 0

RESP2/RESP3 Reply

Integer reply: The number of items successfully added to the bloom filter, or 0 if the key does not exist