jedis icon indicating copy to clipboard operation
jedis copied to clipboard

Implement exclusive range intervals for XRANGE

Open simonprickett opened this issue 2 years ago • 3 comments

Jedis doesn't seem to support the exclusive range intervals feature added in Redis 6.2 for the XRANGE command:

The range is close (inclusive) by default, meaning that the reply can include entries with IDs matching the query's start and end intervals. It is possible to specify an open interval (exclusive) by prefixing the ID with the character (

Implement this using a new invocation of XRANGE or add it to StreamEntryID and have the XRANGE code look for it in the IDs passed?

simonprickett avatar Mar 02 '22 14:03 simonprickett

@simonprickett This is available since Jedis 4.0 by

List<StreamEntry> xrange(String key, String start, String end);
List<StreamEntry> xrange(String key, String start, String end, int count);

where users are expected to do '(' + id.toString() for start and end.

This is nothing fancy but at least similar to ZRANGE.

sazzad16 avatar Mar 02 '22 16:03 sazzad16

Thanks - we subsequently realized this, I feel a more idiomatic / explicit approach would be a nice to have though.

simonprickett avatar Mar 02 '22 16:03 simonprickett

This issue is marked stale. It will be closed in 30 days if it is not updated.

github-actions[bot] avatar Jan 03 '24 00:01 github-actions[bot]