# Set multiple fields
assert redis.hset("myhash"{
  "field1": "Hello",
  "field2": "World"
}) == 2

Arguments

key
str
required

The key of the hash.

fields
Dict[str, Any]
required

A dictionary of fields and their values.

Response

The number of fields that were added.

# Set multiple fields
assert redis.hset("myhash"{
  "field1": "Hello",
  "field2": "World"
}) == 2