Overall
SDKs
- Typescript
- @upstash/redis
- @upstash/query
- @upstash/vector
- @upstash/edge-flags
- @upstash/ratelimit
- @upstash/kafka
- @upstash/qstash
- Python
DevOps
- Terraform
- Pulumi
- CLI
Hash
HLEN
Returns the number of fields contained in the hash stored at key.
Copy
Ask AI
await redis.hset("key", {
id: 1,
username: "chronark",
});
const fields = await redis.hlen("key");
console.log(fields); // 2
Arguments
The key of the hash.
Response
How many fields are in the hash.
Copy
Ask AI
await redis.hset("key", {
id: 1,
username: "chronark",
});
const fields = await redis.hlen("key");
console.log(fields); // 2
Was this page helpful?
Copy
Ask AI
await redis.hset("key", {
id: 1,
username: "chronark",
});
const fields = await redis.hlen("key");
console.log(fields); // 2
Assistant
Responses are generated using AI and may contain mistakes.