diff options
-rwxr-xr-x | redis/client.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/redis/client.py b/redis/client.py index c99b817..3acfb9f 100755 --- a/redis/client.py +++ b/redis/client.py @@ -824,6 +824,16 @@ class StrictRedis(object): """ return self.execute_command('DECRBY', name, amount) + def decrby(self, name, amount=1): + """ + Decrements the value of ``key`` by ``amount``. If no key exists, + the value will be initialized as 0 - ``amount`` + """ + + # An alias for ``decr()``, because it is already implemented + # as DECRBY redis command. + return self.decr(name, amount) + def delete(self, *names): "Delete one or more keys specified by ``names``" return self.execute_command('DEL', *names) |