List

LSET

Set a value at a specific index.

Arguments

keybodystringrequired

The key of the list.

indexbodynumberrequired

At which index to set the value.

databodyTValuerequired

The value to set.

Response

OKrequired

OK

Example
await redis.lpush("key", "a", "b", "c"); await redis.lset("key", 1, "d"); // list is now ["a", "d", "c"]
Loading search…