Skip to content

Streams: XTRIM by streamID #6640

@guybe7

Description

@guybe7

it could be nice if XTRIM had a mode in which it trims all entries with ID < minimal-wanted-id... for example:

127.0.0.1:6379> XRANGE x - +
1) 1) "1575363001970-0"
   2) 1) "f1"
      2) "v1"
2) 1) "1575363004144-0"
   2) 1) "f1"
      2) "v1"
3) 1) "1575363004833-0"
   2) 1) "f1"
      2) "v1"
4) 1) "1575363005448-0"
   2) 1) "f1"
      2) "v1"
5) 1) "1575363006264-0"
   2) 1) "f1"
      2) "v1"
127.0.0.1:6379> XTRIM x MINID 1575363005439-0
(integer) 3
127.0.0.1:6379> XRANGE x - +
1) 1) "1575363005448-0"
   2) 1) "f1"
      2) "v1"
2) 1) "1575363006264-0"
   2) 1) "f1"
      2) "v1"

it could even work with the ~ modifier, trimming only full rax nodes where the last entry has ID < minimal-wanted-id

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions