Skip to main content

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 }
});
I