Search code examples
redispipelinebloom-filter

Is it possible to pipeline Redis bloom filter commands?


Redis has a module for working with bloom filters:

https://oss.redislabs.com/redisbloom/Bloom_Commands/

Redis also allows for pipelining of commands:

https://redis.io/topics/pipelining

Specifically I am looking to check for the existence of a long list of items in a bloom filter. In the current implementation this requires me to issue N individual requests, one for each item in the checklist.

Looking for client code examples to pipeline a batch of BF.EXISTS calls in one network request.


Solution

  • No need to use pipeline. Instead, you can use BF.MEXISTS command to check multiple items:

    BF.MEXISTS key item1 item2 item3