await redis.hset("key", { id: 1, username: "chronark", name: "andreas" });const [newCursor, fields] = await redis.hscan("key", 0);console.log(newCursor); // likely `0` since this is a very small hashconsole.log(fields); // ["id", "username", "name"]
Hash
HSCAN
Scan a hash for fields.
Copy
Ask AI
await redis.hset("key", { id: 1, username: "chronark", name: "andreas" });const [newCursor, fields] = await redis.hscan("key", 0);console.log(newCursor); // likely `0` since this is a very small hashconsole.log(fields); // ["id", "username", "name"]
The new cursor and the fields.
If the new cursor is 0 the iteration is complete.
Copy
Ask AI
await redis.hset("key", { id: 1, username: "chronark", name: "andreas" });const [newCursor, fields] = await redis.hscan("key", 0);console.log(newCursor); // likely `0` since this is a very small hashconsole.log(fields); // ["id", "username", "name"]