Skip to main content

Arguments

group
string
required
The consumer group name.
consumer
string
required
The consumer name within the group.
key
string | string[]
required
The stream key(s) to read from. Can be a single stream key or an array of stream keys for multiple streams.
ids
string | string[]
required
The starting ID(s) to read from. Use ”>” to read messages never delivered to any consumer in the group. For multiple streams, provide an array of IDs corresponding to each stream.
options

Response

Returns an array where each element represents a stream and contains:
  • The stream key
  • An array of messages (ID and field-value pairs)
Returns null if no data is available.
const result = await redis.xreadgroup("mygroup", "consumer1", "mystream", ">");
[
  ["mystream", [
    ["1638360173533-0", ["field1", "value1", "field2", "value2"]],
    ["1638360173533-1", ["field1", "value3", "field2", "value4"]]
  ]]
]
I