Sets the list element at index
to value
.
For more information on the index
argument, see LINDEX.
An error is returned for out of range indexes.
返回值
例子
redis>
RPUSH mylist "one"
(integer) 1redis> RPUSH mylist "two"
(integer) 2redis> RPUSH mylist "three"
(integer) 3redis> LSET mylist 0 "four"
OKredis> LSET mylist -2 "five"
OKredis> LRANGE mylist 0 -1
1) "four" 2) "five" 3) "three"