# Set a single field
assert redis.hset("myhash", "field1", "Hello") == 1

Arguments

key
str
required
The key of the hash.
field
str
Field to set
value
str
Value to set
fields
Dict[str, Any]
An object of fields and their values.

Response

The number of fields that were added.
# Set a single field
assert redis.hset("myhash", "field1", "Hello") == 1