Skip to content

Commit

Permalink
Adding connection step to bloom filter examples (#2478)
Browse files Browse the repository at this point in the history
* Fixes #2415, adds a connect step to bloom commands

* Update redismodules.rst

Apply feedback
  • Loading branch information
nermiller committed Nov 30, 2022
1 parent f492f85 commit dfe2152
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions docs/redismodules.rst
Expand Up @@ -12,25 +12,28 @@ These are the commands for interacting with the `RedisBloom module <https://redi
**Create and add to a bloom filter**

.. code-block:: python
import redis
filter = redis.bf().create("bloom", 0.01, 1000)
filter.add("bloom", "foo")
import redis
r = redis.Redis()
r.bf().create("bloom", 0.01, 1000)
r.bf().add("bloom", "foo")
**Create and add to a cuckoo filter**

.. code-block:: python
import redis
filter = redis.cf().create("cuckoo", 1000)
filter.add("cuckoo", "filter")
import redis
r = redis.Redis()
r.cf().create("cuckoo", 1000)
r.cf().add("cuckoo", "filter")
**Create Count-Min Sketch and get information**

.. code-block:: python
import redis
r = redis.cms().initbydim("dim", 1000, 5)
r = redis.Redis()
r.cms().initbydim("dim", 1000, 5)
r.cms().incrby("dim", ["foo"], [5])
r.cms().info("dim")
Expand All @@ -39,8 +42,9 @@ These are the commands for interacting with the `RedisBloom module <https://redi
.. code-block:: python
import redis
r = redis.topk().reserve("mytopk", 3, 50, 4, 0.9)
info = r.topk().info("mytopk)
r = redis.Redis()
r.topk().reserve("mytopk", 3, 50, 4, 0.9)
r.topk().info("mytopk)
.. automodule:: redis.commands.bf.commands
:members: BFCommands, CFCommands, CMSCommands, TOPKCommands
Expand Down

0 comments on commit dfe2152

Please sign in to comment.