Adding connection step to bloom filter examples
* Fixes adds a connect step to bloom commands
* Update redismodules.rst
Apply feedback
@@ -14,23 +14,26 @@ These are the commands for interacting with the `RedisBloom module <https://redi
.. code-block:: python
import redis
- filter = redis.bf().create("bloom", 0.01, 1000)
- filter.add("bloom", "foo")
+ 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")
+ 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")
@@ -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
