Redis Command: LINSERT

Insert an element in the list, before or after a specific element. This command does not insert an element at a specific position/index of the list. It searches for the reference element(pivot), and after the pivot element is found then the new element is inserted before/after that specific element. So finding the pivot element is important. If the pivot/reference is not found then the command fails.

Redis Command: LINDEX

Get an element from a list at a specific index. Time complexity of this command is O(N). Here N is the number of items that we have to go through to get the specified index. In the case of positive indexing, the counting starts from the HEAD/Left. In the case of negative indexing, the counting starts from the TAIL/Right end.

Redis Command: DECR

Decrease the value stored in by One(1). If the key does not exist then this command will set the key and the value will be Zero(0), before performing the operation. And after the operation is performed, the value will be negative one(-1). If the value is not an integer, like a string that can not be covered to an integer, or a list, set, etc. then this command will return an error.