diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2010-03-10 13:57:26 -0800 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2010-03-10 13:57:26 -0800 |
commit | 708c458adb8d90a00041977df4880d28a11e2cb9 (patch) | |
tree | 921896391cce28894e22b7c8685f81bef816fc18 /redis/client.py | |
parent | 263581708f5397804e2d42fc50b4c4b9f717f224 (diff) | |
download | redis-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.py | 6 |
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) |