XTRIM

Trims a stream to a maximum entry count.

Streams · Example verified

Syntax covered here

XTRIM key MAXLEN threshold

The tested threshold is zero, removing the sole entry without approximate-trimming options.

Tested example & replies

Requests below run in order against an empty database. Each connection authenticates with the fixture password first. Quoted values are strings; null is a nil reply; arrays preserve RESP order.

# connection: default
> XADD events 1-0 event created
"1-0"
# connection: default
> XTRIM events MAXLEN 0
1