Skip to content

Commit

Permalink
Use HSET instead of HMSET.
Browse files Browse the repository at this point in the history
Fixes #129
  • Loading branch information
coleifer committed Jun 24, 2020
1 parent 70b83b0 commit 4f820b3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions walrus/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,13 @@ def setnx(self, key, value):
return bool(self.database.hsetnx(self.key, key, value))

@chainable_method
def update(self, *args, **kwargs):
def update(self, __data=None, **kwargs):
"""
Update the hash using the given dictionary or key/value pairs.
"""
if args:
self.database.hmset(self.key, *args)
else:
self.database.hmset(self.key, kwargs)
if __data is not None:
kwargs.update(__data)
return self.database.hset(self.key, mapping=kwargs)

def incr(self, key, incr_by=1):
"""Increment the key by the given amount."""
Expand Down

0 comments on commit 4f820b3

Please sign in to comment.