Return a random field from a hash
await redis.hset("key", { id: 1, username: "chronark", name: "andreas" }); const randomField = await redis.hrandfield("key"); console.log(randomField); // one of "id", "username" or "name"
The key of the hash.
Optionally return more than one field.
Return the values of the fields as well.
An object containing the fields and their values.
Was this page helpful?