# BF.CARD

> Return the number of items added to a Bloom filter.

URL: https://docs.hotkv.com/commands/bf-card/

```
BF.CARD key
```

- Group: Bloom filter
- Complexity: O(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

| 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

```
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
```

## Compatibility

Same as `BF.CARD` in RedisBloom.

## See also

[BF.INFO](https://docs.hotkv.com/commands/bf-info/index.md), [BF.ADD](https://docs.hotkv.com/commands/bf-add/index.md)