XGROUP SETID
XGROUP SETID key group <id | $> [ENTRIESREAD entries-read]
- Group
- Stream
- Complexity
- O(1)
- Arity
- -5 (at least 5 words, counting the command name)
- HotKV Cloud
- All plans
- On-Premise
- no license needed
XGROUP SETID moves the consumer group’s last delivered ID. The next
XREADGROUP with > delivers entries after it. Set it
to 0 to have the group read the whole stream again, or to $ to skip
everything already in the stream.
The pending entries list is not changed.
Options
Section titled “Options”| Option | Effect |
|---|---|
ENTRIESREAD entries-read |
Set the group’s count of entries read, used for its lag in XINFO GROUPS. -1 means unknown. |
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| ID set | Simple string OK |
Simple string OK |
Error replies:
NOGROUP No such consumer group 'group' for key name 'key'ERR The XGROUP subcommand requires the key to exist. ...when the stream does not exist.ERR Invalid stream ID specified as stream command argumentERR value for ENTRIESREAD must be positive or -1ERR unknown subcommand or wrong number of arguments for 'SETID'. Try XGROUP HELP.WRONGTYPEif the key holds another type.
Examples
Section titled “Examples”127.0.0.1:6379> XADD orders 1700000000000-0 item book"1700000000000-0"127.0.0.1:6379> XGROUP CREATE orders billing $OK127.0.0.1:6379> XREADGROUP GROUP billing w1 STREAMS orders >(nil)127.0.0.1:6379> XGROUP SETID orders billing 0OK127.0.0.1:6379> XREADGROUP GROUP billing w1 STREAMS orders >1) 1) "orders" 2) 1) 1) "1700000000000-0" 2) 1) "item" 2) "book"Compatibility
Section titled “Compatibility”Same as Redis 7 and Valkey 8.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.