XTRIM
Trim a stream by length or minimum ID.
XTRIM key MAXLEN|MINID [=|~] threshold
Complexity
O(R log N + N*F) for R evicted entries
Complexity and compatibility are read out of kevy's implementation, not copied from Redis's reference. Several genuinely differ.
Redis compatibility
Differs
'~' is accepted but trimming is always exact, LIMIT is not parsed, and trailing tokens after the threshold are silently ignored instead of erroring
See also
XACKXADDXAUTOCLAIMXCLAIMXDELXGROUPXINFOXLENXPENDINGXRANGEXREADXREADGROUPXREVRANGEXSETID