hDel(key: string, ...fields: string[]): number
Parameter | Type | Description |
key | string | Key name. |
...fields | string[] | Field name. |
Type | Description |
number | On success, the number of deleted entries is returned. |
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 hDelResp = client.hDel("hash", "k");console.log(redis hDel $
{
hDelResp
}
); // 1}