Skip to content
masterclass Buddy

Redis · Command

XLEN

Returns the number of entries in a Redis stream. A missing key returns zero, so check the key separately if you must distinguish a missing stream from an empty one.

Last updated

Since
5.0.0

Syntax

XLEN key

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • XADD
  • XDEL
  • TYPE
  • EXISTS
  • XINFO STREAM

Source: XLEN | Docs. Checked 2026-11-03.