Hello Alejandro,
could you give us a bit more background regarding the concrete use case? Time series use cases are often append-only (as events are usually occuring in a kind of timely order).
I could imagine that you might have multiple sources and you want to update the stream from these sources in batches. Maybe one batch has an earlier timestamp in it than one which you did already add to the stream. If this is the case then one solution could be to:
C. Use one stream per source (e.g, sensor) and then combine the results by using XREAD
Here an example:
127.0.0.1:6379> FLUSHDB
OK
127.0.0.1:6379> XADD my:sensor:1 * "id" "1"
"1564558318886-0"
127.0.0.1:6379> XADD my:sensor:1 * "id" "2"
"1564558330094-0"
127.0.0.1:6379> XADD my:sensor:2 "1564558318886-1" "id" "3"
"1564558318886-1"
127.0.0.1:6379> XREAD STREAMS my:sensor:1 my:sensor:2 0-0 0-0
1) 1) "my:sensor:1"
2) 1) 1) "1564558318886-0"
2) 1) "id"
2) "1"
2) 1) "1564558330094-0"
2) 1) "id"
2) "2"
2) 1) "my:sensor:2"
2) 1) 1) "1564558318886-1"
2) 1) "id"
2) "3"
BTW: The result is grouped by stream. So you might want to flatten it down into one result stream again.
Hope this helps.
Regards,
David