Skip to content
masterclass Buddy

Redis · Command

XTRIM

XTRIM removes older entries from a Redis stream. It can limit the stream by length with MAXLEN or by entry ID with MINID.

Last updated

Since
5.0.0

Syntax

XTRIM key <MAXLEN | MINID> [= | ~] threshold [LIMIT count] [KEEPREF | DELREF | ACKED]

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

Subscribe
  • XADD
  • XACK
  • XDEL
  • XLEN
  • XRANGE
  • XREADGROUP

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