Upstash Documentation

XTRIM

Trims the stream by removing entries to keep it at a reasonable size.
1 min read

Arguments#

keystrrequired#

The key of the stream.

maxlenint#

The maximum number of entries to keep in the stream. Mutually exclusive with minid.

approximatebool#

Use approximate trimming (more efficient). When True, Redis may keep slightly more entries than specified. Defaults to True.

Default: "True"

minidstr#

The minimum ID to keep. Entries with IDs lower than this will be removed. Mutually exclusive with maxlen.

limitint#

Limit how many entries will be trimmed at most.

Response#