tencent cloud

Client.hLen
最終更新日:2025-03-10 17:15:11
Client.hLen
最終更新日: 2025-03-10 17:15:11
The hLen method is used to obtain the number of fields in the hash table.
hLen(key: string): number

Parameters

Parameter
Type
Description
key
string
Key name.

Return

Type
Description
number
On success, the number of entries is returned.

Samples

import redis from "pts/redis";

let client = new redis.Client("redis://:<password>@<host>:6379/0");

export default function main() {
let hSetResp = client.hSet("hash", "k", 1, "k1", 2);
console.log(redis hSet ${hSetResp}); // 2
let hLenResp = client.hLen("hash");
console.log(redis hLen ${hLenResp}); // 2
}

この記事はお役に立ちましたか?
営業担当者に お問い合わせ いただくか チケットを提出 してサポートを求めることができます。
はい
いいえ

フィードバック