From 708c458adb8d90a00041977df4880d28a11e2cb9 Mon Sep 17 00:00:00 2001 From: Andy McCurdy Date: Wed, 10 Mar 2010 13:57:26 -0800 Subject: HSET now returns 1 if it added a new field to the hash, otherwise 0. There was no test for RPUSH, now there is :) --- redis/client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'redis/client.py') 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) -- cgit v1.2.1