MCPcopy Create free account
hub / github.com/dbProjectRED/redimo.go / XREVRANGE

Method XREVRANGE

streams.go:744–746  ·  view source on GitHub ↗

XREVRANGE is similar to XRANGE, but in reverse order. The stream items in descending chronological order. Using the same example as XRANGE, when fetching items in reverse order there are some differences when paginating. The first set of records can be fetched using: XRANGE(key, NewTimeXID(endOfFebr

(key string, end, start XID, count int64)

Source from the content-addressed store, hash-verified

742// XRANGE(key, lastFetchedItemID.Prev(), NewTimeXID(beginningOfFebruary).First(), 1000)
743// Works similar to https://redis.io/commands/xrevrange
744func (c Client) XREVRANGE(key string, end, start XID, count int64) (streamItems []StreamItem, err error) {
745 return c.xRange(key, start, end, count, false)
746}
747
748func (c Client) XTRIM(key string, newCount int64) (deletedCount int64, err error) {
749 hasMoreResults := true

Callers 2

TestStreamCRUFunction · 0.80
TestRangesFunction · 0.80

Calls 1

xRangeMethod · 0.95

Tested by 2

TestStreamCRUFunction · 0.64
TestRangesFunction · 0.64