Arguments#
The key of the stream.
Response#
number
The number of entries removed from the stream.
Skip to main contentDocumentation index
Fetch the complete documentation index at: /llms.txt
Ask it with GET /ask?q=<keywords or question>. Short keywords rank best.
Use these to discover all available pages before exploring further.
Feature requests: /common/help/feature-requests.md lists what users asked for and how to vote for a request or add one.
Page rating: `GET /feedback?path=<this page's path>&helpful=true` (or `false`) records whether this page helped. An optional `comment` (URL-encoded, at most 500 characters) says what was missing or wrong. It is anonymous and needs no key. Comments hold no code, secrets or personal data.
The key of the stream.
The trimming strategy:
MAXLEN: Trim based on the maximum number of entriesMINID: Trim based on the minimum IDThe threshold value for trimming:
MAXLEN: The maximum number of entries to keep (number)MINID: The minimum ID to keep (string). Entries with IDs lower than this will be removedUse ~ for approximate trimming (more efficient, default) or = for exact trimming.
Limit how many entries will be trimmed at most (only valid with approximate trimming ~).
The number of entries removed from the stream.
Was this page helpful?
const result = await redis.xtrim("mystream", { strategy: "MAXLEN", threshold: 100, exactness: "~"});const result = await redis.xtrim("mystream", { strategy: "MAXLEN", threshold: 50, exactness: "="});const result = await redis.xtrim("mystream", { strategy: "MINID", threshold: "1638360173533-0", exactness: "="});const result = await redis.xtrim("mystream", { strategy: "MAXLEN", threshold: 1000, exactness: "~", limit: 100});