diff options
Diffstat (limited to 'docs/redismodules.rst')
-rw-r--r-- | docs/redismodules.rst | 115 |
1 files changed, 59 insertions, 56 deletions
diff --git a/docs/redismodules.rst b/docs/redismodules.rst index 53a5008..f311675 100644 --- a/docs/redismodules.rst +++ b/docs/redismodules.rst @@ -3,63 +3,49 @@ Redis Modules Commands Accessing redis module commands requires the installation of the supported `Redis module <https://docs.redis.com/latest/modules/>`_. For a quick start with redis modules, try the `Redismod docker <https://hub.docker.com/r/redislabs/redismod>`_. -RedisTimeSeries Commands -************************ -These are the commands for interacting with the `RedisTimeSeries module <https://redistimeseries.io>`_. Below is a brief example, as well as documentation on the commands themselves. +RedisBloom Commands +******************* +These are the commands for interacting with the `RedisBloom module <https://redisbloom.io>`_. Below is a brief example, as well as documentation on the commands themselves. -**Create a timeseries object with 5 second retention** +**Create and add to a bloom filter** .. code-block:: python import redis - r = redis.Redis() - r.timeseries().create(2, retension_msecs=5) - -.. automodule:: redis.commands.timeseries.commands - :members: TimeSeriesCommands - ------ - -RedisJSON Commands -****************** - -These are the commands for interacting with the `RedisJSON module <https://redisjson.io>`_. Below is a brief example, as well as documentation on the commands themselves. + filter = redis.bf().create("bloom", 0.01, 1000) + filter.add("bloom", "foo") -**Create a json object** +**Create and add to a cuckoo filter** .. code-block:: python import redis - r = redis.Redis() - r.json().set("mykey", ".", {"hello": "world", "i am": ["a", "json", "object!"]} - - -.. automodule:: redis.commands.json.commands - :members: JSONCommands + filter = redis.cf().create("cuckoo", 1000) + filter.add("cuckoo", "filter") ------ +**Create Count-Min Sketch and get information** -RediSearch Commands -******************* +.. code-block:: python -These are the commands for interacting with the `RediSearch module <https://redisearch.io>`_. Below is a brief example, as well as documentation on the commands themselves. + import redis + r = redis.cms().initbydim("dim", 1000, 5) + r.cms().incrby("dim", ["foo"], [5]) + r.cms().info("dim") -**Create a search index, and display its information** +**Create a topk list, and access the results** .. code-block:: python import redis - r = redis.Redis() - r.ft().create_index(TextField("play", weight=5.0), TextField("ball")) - print(r.ft().info()) - + r = redis.topk().reserve("mytopk", 3, 50, 4, 0.9) + info = r.topk().info("mytopk) -.. automodule:: redis.commands.search.commands - :members: SearchCommands +.. automodule:: redis.commands.bf.commands + :members: BFCommands, CFCommands, CMSCommands, TOPKCommands ------ +------ RedisGraph Commands ******************* @@ -92,45 +78,62 @@ These are the commands for interacting with the `RedisGraph module <https://redi .. automodule:: redis.commands.graph.commands :members: GraphCommands ------ +------ -RedisBloom Commands -******************* +RedisJSON Commands +****************** -These are the commands for interacting with the `RedisBloom module <https://redisbloom.io>`_. Below is a brief example, as well as documentation on the commands themselves. +These are the commands for interacting with the `RedisJSON module <https://redisjson.io>`_. Below is a brief example, as well as documentation on the commands themselves. -**Create and add to a bloom filter** +**Create a json object** .. code-block:: python import redis - filter = redis.bf().create("bloom", 0.01, 1000) - filter.add("bloom", "foo") + r = redis.Redis() + r.json().set("mykey", ".", {"hello": "world", "i am": ["a", "json", "object!"]} -**Create and add to a cuckoo filter** -.. code-block:: python +.. automodule:: redis.commands.json.commands + :members: JSONCommands - import redis - filter = redis.cf().create("cuckoo", 1000) - filter.add("cuckoo", "filter") +----- -**Create Count-Min Sketch and get information** +RediSearch Commands +******************* + +These are the commands for interacting with the `RediSearch module <https://redisearch.io>`_. Below is a brief example, as well as documentation on the commands themselves. + +**Create a search index, and display its information** .. code-block:: python import redis - r = redis.cms().initbydim("dim", 1000, 5) - r.cms().incrby("dim", ["foo"], [5]) - r.cms().info("dim") + r = redis.Redis() + r.ft().create_index(TextField("play", weight=5.0), TextField("ball")) + print(r.ft().info()) -**Create a topk list, and access the results** + +.. automodule:: redis.commands.search.commands + :members: SearchCommands + +----- + +RedisTimeSeries Commands +************************ + +These are the commands for interacting with the `RedisTimeSeries module <https://redistimeseries.io>`_. Below is a brief example, as well as documentation on the commands themselves. + + +**Create a timeseries object with 5 second retention** .. code-block:: python import redis - r = redis.topk().reserve("mytopk", 3, 50, 4, 0.9) - info = r.topk().info("mytopk) + r = redis.Redis() + r.timeseries().create(2, retension_msecs=5) + +.. automodule:: redis.commands.timeseries.commands + :members: TimeSeriesCommands + -.. automodule:: redis.commands.bf.commands - :members: BFCommands, CFCommands, CMSCommands, TOPKCommands |