LSET
Syntax
LSET key index element
- Available since:
- 1.0.0
- Time complexity:
- O(N) where N is the length of the list. Setting either the first or the last element of the list is O(1).
- ACL categories:
-
@write,@list,@slow,
将列表中的元素设置为index处的element。
有关index参数的更多信息,请参见LINDEX。
对于超出范围的索引,将返回错误。
示例
RESP2/RESP3 回复
Simple string reply:OK.