Recommanded Free YOUTUBE Lecture: <% selectedImage[1] %>

LPOP Key

  • 지원 버전 : 1.0.0.
  • 시간 복잡도 : O(1)
LPOP의 L은 List가 아닌, Left다. 리스트(List)에서 왼쪽 첫번째 요소를 꺼낸 후 삭제한다.

반환 값

첫번째 요소를 꺼낸다. 키가 없다면 nil을 반환한다.

예제

redis>  RPUSH mylist "one"
(integer) 1
redis>  RPUSH mylist "two"
(integer) 2
redis>  RPUSH mylist "three"
(integer) 3
redis>  LPOP mylist
"one"
redis>  LRANGE mylist 0 -1
1) "two"
2) "three"
redis>