产品动态
hLen(key: string): number
参数 | 类型 | 描述 |
key | string | 键名 |
类型 | 描述 |
number | 成功时,返回条目的数量 |
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}`); // 2let hLenResp = client.hLen("hash");console.log(`redis hLen ${hLenResp}`); // 2}
文档反馈