TS.RANGE, TS.REVRANGE, TS.MRANGE, and TS.MREVRANGE are range commands. You need to specify the range start and end timestamps.
Instead of specifying concrete values, you can you -
and +
respectively.
RedisTimeSeries replaces -
with the timestamp of the earliest sample in the time series, and +
with the timestamp of the latest sample in the time series.
Note that the query you composed
TS.RANGE sensor1 - + FILTER_BY_TS 1626435230501 1626443276598
would report samples only for two specific timestamps: 1626435230501 and 1626443276598, as FILTER_BY_TS
is used for specifying a set of exact timestamps - not a range (to retrieve results, you must have samples with these exact timestamps, and these timestamps must fall within [fromTimestamp
.. toTimestamp
] which is [-
.. +
] in your case).
If you want to retrieve all samples between timestamp 1626435230501 and timestamp 1626443276598, you should instead use
TS.RANGE sensor1 1626435230501 1626443276598
And if you want to retrieve all samples in the time series, you can use
TS.RANGE sensor1 - +