lIndex(key: string, index: number): string
Parameter | Type | Description |
key | string | Key name. |
index | number | Index. |
Type | Description |
string | On success, the elements for the index are 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 lIndexResp = client.lIndex("list", 1);console.log(redis lIndex ${lIndexResp}); // bar}
Feedback