method

RedisClient.xrange

key: KeyLike,
start: string,
end: string,
...options: string | number[]
): Promise<[string, string[]][]>;

Get a range of entries from a stream

@param key

The stream key

@param start

The start ID (use "-" for the minimum ID)

@param end

The end ID (use "+" for the maximum ID)

@param options

Optional COUNT modifier

@returns

Promise that resolves with an array of [id, [field, value, ...]] entries

await redis.xrange("mystream", "-", "+");
await redis.xrange("mystream", "-", "+", "COUNT", 10);

Referenced types

type KeyLike = string | ArrayBufferView | Blob