Hash

HGET

Retrieves the value of a hash field.

Arguments

keybodystringrequired

The key to get.

fieldbodystringrequired

The field to get.

Response

TValue | nullrequired

The value of the field, or null, when field is not present in the hash or key does not exist.

Example
await redis.hset("key", {field: "value"});const field = await redis.hget("key", "field");console.log(field); // "value"
Loading search…