summaryrefslogtreecommitdiff
path: root/redis/client.py
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2010-03-10 13:57:26 -0800
committerAndy McCurdy <andy@andymccurdy.com>2010-03-10 13:57:26 -0800
commit708c458adb8d90a00041977df4880d28a11e2cb9 (patch)
tree921896391cce28894e22b7c8685f81bef816fc18 /redis/client.py
parent263581708f5397804e2d42fc50b4c4b9f717f224 (diff)
downloadredis-py-708c458adb8d90a00041977df4880d28a11e2cb9.tar.gz
HSET now returns 1 if it added a new field to the hash, otherwise 0.
There was no test for RPUSH, now there is :)
Diffstat (limited to 'redis/client.py')
-rw-r--r--redis/client.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/redis/client.py b/redis/client.py
index 908c933..d0f7516 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -181,7 +181,6 @@ class Redis(threading.local):
string_keys_to_dict('ZRANGE ZRANGEBYSCORE ZREVRANGE', zset_score_pairs),
{
'BGSAVE': lambda r: r == 'Background saving started',
- 'HSET': lambda r: True,
'INFO': parse_info,
'LASTSAVE': timestamp_to_datetime,
'PING': lambda r: r == 'PONG',
@@ -874,7 +873,10 @@ class Redis(threading.local):
return self.format_bulk('HGET', name, key)
def hset(self, name, key, value):
- "Set ``key`` to ``value`` within hash ``name``"
+ """
+ Set ``key`` to ``value`` within hash ``name``
+ Returns 1 if HSET created a new field, otherwise 0
+ """
return self.format_multi_bulk('HSET', name, key, value)