Skip to main content

LSET

Note

Official reference: LSET.

Replace an element at an index.

Syntax

LSET key index element

Indices start at zero; negative indices count from the end, with -1 denoting the last element.

Results

ReturnRowsContent
Update count--1 if successful, 0 otherwise. (Success when status is "OK")

Example

RPUSH demo:queue first second
LSET demo:queue 0 changed