Hash
HMGET
Return the requested fields and their values.
Arguments
keybodystringrequired
The key of the hash.
fieldsbody...string[]required
One or more fields to get.
Response
Record<string, unknown>required
An object containing the fields and their values.
Example
await redis.hset("key", { id: 1, username: "chronark", name: "andreas" });const fields = await redis.hmget("key", "username", "name");console.log(fields); // { username: "chronark", name: "andreas" }