Redis Commands
- A
- B
- Client
-
Cluster
- Cluster-addslots
- Cluster-addslotsrange
- Cluster-bumpepoch
- Cluster-count-failure-reports
- Cluster-countkeysinslot
- Cluster-delslots
- Cluster-delslotsrange
- Cluster-failover
- Cluster-flushslots
- Cluster-forget
- Cluster-getkeysinslot
- Cluster-help
- Cluster-info
- Cluster-keyslot
- Cluster-links
- Cluster-meet
- Cluster-myid
- Cluster-myshardid
- Cluster-nodes
- Cluster-replicas
- Cluster-replicate
- Cluster-reset
- Cluster-saveconfig
- Cluster-set-config-epoch
- Cluster-setslot
- Cluster-shards
- Cluster-slaves
- Cluster-slots
- Cluster
- Command
- Config
- D
- E
- F
- G
- H
- I
- K
- L
- M
- O
- P
- Q
- R
- S1
- S2
- T
- U
- W
- X
- Z1
- Z2
Docs > Redis Commands > L > Lindex
Returns the element at index index
in the list stored at key
.
The index is zero-based, so 0
means the first element, 1
the second element
and so on.
Negative indices can be used to designate elements starting at the tail of the
list.
Here, -1
means the last element, -2
means the penultimate and so forth.
When the value at key
is not a list, an error is returned.
@return
@bulk-string-reply: the requested element, or nil
when index
is out of range.
@examples
LPUSH mylist "World"
LPUSH mylist "Hello"
LINDEX mylist 0
LINDEX mylist -1
LINDEX mylist 3