TS.DEL key from_timestamp to_timestamp

Available in: Redis Stack

Time complexity: O(N) where N is the number of data points that will be removed

TS.DEL

(since RedisTimeSeries v1.6)

Delete all samples between two timestamps for a given time series.

The given timestamp interval is closed (inclusive), meaning samples which timestamp eqauls the fromTimestamp or toTimestamp will also be deleted.

TS.DEL key fromTimestamp toTimestamp
  • key - Key name for time series
  • fromTimestamp - Start timestamp for the range deletion.
  • toTimestamp - End timestamp for the range deletion.

Return value

Integer reply: The number of samples that were removed.

Complexity

TS.DEL complexity is O(N) where N is the number of data points that will be removed.

Delete range of data points example

127.0.0.1:6379>TS.DEL temperature:2:32 1548149180000 1548149183000
(integer) 150