Skip to main content

Documentation Index

Fetch the complete documentation index at: https://upstash.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Arguments

key
string
required
The key of the stream.
group
string
required
The consumer group name.
start
string
required
The minimum pending ID to return. Use ”-” for the first available ID.
end
string
required
The maximum pending ID to return. Use ”+” for the last available ID.
count
number
required
The maximum number of pending messages to return.
options

Response

Returns an array of pending message details.
const result = await redis.xpending("mystream", "mygroup", "-", "+", 10);
[
  2, // total pending count
  "1638360173533-0", // smallest pending ID
  "1638360173533-1", // greatest pending ID
  [
    ["consumer1", "1"], // consumer and their pending count
    ["consumer2", "1"]
  ]
]