Hash

HMGET

Return the requested fields and their values.

Arguments

keybodystrrequired

The key of the hash.

fieldsbody*List[str]required

One or more fields to get.

Response

List[str | None]required

An object containing the fields and their values.

Example
redis.hset("myhash", values={    "field1": "Hello",    "field2": "World"})assert redis.hmget("myhash", "field1", "field2") == ["Hello", "World"]
Loading search…