summaryrefslogtreecommitdiff
path: root/redis/commands/redismodules.py
diff options
context:
space:
mode:
Diffstat (limited to 'redis/commands/redismodules.py')
-rw-r--r--redis/commands/redismodules.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/redis/commands/redismodules.py b/redis/commands/redismodules.py
index 3ecce29..457a69e 100644
--- a/redis/commands/redismodules.py
+++ b/redis/commands/redismodules.py
@@ -27,8 +27,22 @@ class RedisModuleCommands:
try:
modversion = self.loaded_modules['search']
except IndexError:
- raise ModuleError("rejson is not a loaded in the redis instance.")
+ raise ModuleError("search is not a loaded in the redis instance.")
from .search import Search
s = Search(client=self, version=modversion, index_name=index_name)
return s
+
+ def ts(self, index_name="idx"):
+ """Access the timeseries namespace, providing support for
+ redis timeseries data.
+ """
+ try:
+ modversion = self.loaded_modules['timeseries']
+ except IndexError:
+ raise ModuleError("timeseries is not a loaded in "
+ "the redis instance.")
+
+ from .timeseries import TimeSeries
+ s = TimeSeries(client=self, version=modversion, index_name=index_name)
+ return s