LSET key index element

    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).

    Sets the list element at to . For more information on the argument, see LINDEX.

    *Examples

    redis> RPUSH mylist "one"

    1. (integer) 2

    redis> RPUSH mylist "three"

    redis> LSET mylist 0 "four"

      redis> LRANGE mylist 0 -1

      1. 1) "four"
      2. 3) "three"
      redis>