From dd874ab02db04853d4b5952712ab34693f9a93de Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 4 Jan 2023 08:19:36 +0100 Subject: Merging upstream version 1.13.0. Signed-off-by: Daniel Baumann --- iredis/data/commands/xgroup-create.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 iredis/data/commands/xgroup-create.md (limited to 'iredis/data/commands/xgroup-create.md') diff --git a/iredis/data/commands/xgroup-create.md b/iredis/data/commands/xgroup-create.md new file mode 100644 index 0000000..f0f1606 --- /dev/null +++ b/iredis/data/commands/xgroup-create.md @@ -0,0 +1,23 @@ +This command creates a new consumer group uniquely identified by `` for the stream stored at ``. + +Every group has a unique name in a given stream. When a consumer group with the same name already exists, the command returns a `-BUSYGROUP` error. + +The command's `` argument specifies the last delivered entry in the stream from the new group's perspective. +The special ID `$` means the ID of the last entry in the stream, but you can provide any valid ID instead. +For example, if you want the group's consumers to fetch the entire stream from the beginning, use zero as the starting ID for the consumer group: + + XGROUP CREATE mystream mygroup 0 + +By default, the `XGROUP CREATE` command insists that the target stream exists and returns an error when it doesn't. +However, you can use the optional `MKSTREAM` subcommand as the last argument after the `` to automatically create the stream (with length of 0) if it doesn't exist: + + XGROUP CREATE mystream mygroup $ MKSTREAM + +The optional `entries_read` named argument can be specified to enable consumer group lag tracking for an arbitrary ID. +An arbitrary ID is any ID that isn't the ID of the stream's first entry, its last entry or the zero ("0-0") ID. +This can be useful you know exactly how many entries are between the arbitrary ID (excluding it) and the stream's last entry. +In such cases, the `entries_read` can be set to the stream's `entries_added` subtracted with the number of entries. + +@return + +@simple-string-reply: `OK` on success. -- cgit v1.2.3