summaryrefslogtreecommitdiff
path: root/redis/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'redis/client.py')
-rw-r--r--redis/client.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/redis/client.py b/redis/client.py
index d475ae3..c7ea3b1 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -169,6 +169,7 @@ class StrictRedis(object):
'SUNIONSTORE ZADD ZCARD ZREMRANGEBYRANK ZREMRANGEBYSCORE',
int
),
+ string_keys_to_dict('INCRBYFLOAT', float),
string_keys_to_dict(
# these return OK, or int if redis-server is >=1.3.4
'LPUSH RPUSH',
@@ -545,6 +546,13 @@ class StrictRedis(object):
"""
return self.execute_command('INCRBY', name, amount)
+ def incrbyfloat(self, name, amount=1.0):
+ """
+ Increments the value at key ``name`` by floating ``amount``.
+ If no key exists, the value will be initialized as ``amount``
+ """
+ return self.execute_command('INCRBYFLOAT', name, amount)
+
def keys(self, pattern='*'):
"Returns a list of keys matching ``pattern``"
return self.execute_command('KEYS', pattern)