Skip to main content

Overview

Returns the length of the list stored at key. If key does not exist, it is interpreted as an empty list and 0 is returned.

Method Signature

Parameters

key
string
required
The key of the list.

Return Value

length
number
The length of the list. Returns 0 if the list does not exist.

Examples

Basic Usage

Queue Size Monitoring

Tracking List Growth

Conditional Operations

Pagination Info

Health Check

Rate Limiting Check

See Also

  • LRANGE - Get a range of elements from a list
  • LPUSH - Insert elements at the head of a list
  • RPUSH - Insert elements at the tail of a list
  • LPOP - Remove and return the first element of a list