- Overall
- Quickstarts
- Features
- SDKs
- Typescript
- Overview
- Get Started
- Commands
- Overview
- Auth
- Bitmap
- Generic
- Hash
- Json
- List
- PubSub
- Scripts
- Server
- Set
- Sorted Set
- Stream
- String
- Transactions
- Deployment
- Pipelining
- Advanced
- Retries
- Troubleshooting
- Developing or Testing
- Python
- Ratelimit (TS)
- Ratelimit (PY)
- How To
- Integrations
- Tutorials
- Troubleshooting
- Help
Hash
HLEN
Returns the number of fields contained in the hash stored at key.
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.
await redis.hset("key", {
id: 1,
username: "chronark",
});
const fields = await redis.hlen("key");
console.log(fields); // 2
Was this page helpful?
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.