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.
SubscribeRelated
XADDXACKXDELXLENXRANGEXREADGROUP