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.
subcommand
object
required
The XGROUP subcommand and its parameters. Can be one of:

Response

The return type depends on the subcommand:
  • CREATE: Returns “OK” string
  • CREATECONSUMER: Returns 1 if created, 0 if already exists
  • DELCONSUMER: Returns the number of pending messages the consumer had
  • DESTROY: Returns 1 if destroyed, 0 if group didn’t exist
  • SETID: Returns “OK” string
const result = await redis.xgroup("mystream", {
  type: "CREATE",
  group: "mygroup",
  id: "$",
  options: { MKSTREAM: true }
});