lSet(key: string, index: number, value: string | number): string
Parameter | Type | Description |
key | string | Key name. |
index | number | Index. |
value | string | number | Value. |
Type | Description |
string | On success, "OK" is returned. |
import redis from "pts/redis";let client = new redis.Client("redis://:<password>@<host>:6379/0");export default function main() {let lPushResp = client.lPush("list", "foo", "bar", "zoo");console.log(redis lPush ${lPushResp}); // 3let lSetResp = client.lSet("list", 1, "bar2");console.log(redis lSet ${lSetResp}); // OKlet lIndexResp = client.lIndex("list", 1);console.log(redis lIndex ${lIndexResp}); // bar2}
Feedback