redisRedis List Datatype


Introduction

The List datatype in Redis is an ordered collection of items referenced by a Redis key. Redis allows you to access and modify a list by index or push/pop operations. In Redis, the two ends of a list are referred to as the left and the right. The left corresponds to the first element or head of a list and the right coresponds to the last element or tail of a list.

Syntax

  • LPUSH key value [value ...]
  • RPUSH key value [value ...]
  • LPOP key
  • RPOP key
  • LLEN key

Remarks

More detail on the List datatype and all the commands that can be used in conjunction with them can be found in the official Redis documentation at Redis.io.