diff options
-rw-r--r-- | redis/client.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/redis/client.py b/redis/client.py index 2964aa7..234b140 100644 --- a/redis/client.py +++ b/redis/client.py @@ -614,6 +614,16 @@ class StrictRedis(object): """ return self.execute_command('INCRBY', name, amount) + def incrby(self, name, amount=1): + """ + Increments the value of ``key`` by ``amount``. If no key exists, + the value will be initialized as ``amount`` + """ + + # An alias for ``incr()``, because it is already implemented + # as INCRBY redis command. + return self.incr(name, amount) + def incrbyfloat(self, name, amount=1.0): """ Increments the value at key ``name`` by floating ``amount``. |