content/commands/ts.del.md
Delete all samples between two timestamps for a given time series
is key name for the time series.
</details> <details open><summary><code>fromTimestamp</code></summary>is start timestamp for the range deletion.
</details> <details open><summary><code>toTimestamp</code></summary>is end timestamp for the range deletion.
The given timestamp interval is closed (inclusive), meaning that samples whose timestamp eqauls the fromTimestamp or toTimestamp are also deleted.
<note><b>Notes:</b>
Create time series for temperature in Tel Aviv and Jerusalem, then add different temperature samples.
{{< highlight bash >}} 127.0.0.1:6379> TS.CREATE temp:TLV LABELS type temp location TLV OK 127.0.0.1:6379> TS.CREATE temp:JLM LABELS type temp location JLM OK 127.0.0.1:6379> TS.MADD temp:TLV 1000 30 temp:TLV 1010 35 temp:TLV 1020 9999 temp:TLV 1030 40
Delete the range of data points for temperature in Tel Aviv.
{{< highlight bash >}} 127.0.0.1:6379> TS.DEL temp:TLV 1000 1030 (integer) 4 {{< / highlight >}}
</details>| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Supported</span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | |
{{< multitabs id="ts-del-return-info" tab1="RESP2" tab2="RESP3" >}}
One of the following:
timestamp is older than the retention period compared to the maximum existing timestamp, or when an affected compaction bucket cannot be recalculated.-tab-sep-
One of the following:
timestamp is older than the retention period compared to the maximum existing timestamp, or when an affected compaction bucket cannot be recalculated.{{< /multitabs >}}
[TS.ADD]({{< relref "commands/ts.add/" >}})
[RedisTimeSeries]({{< relref "/develop/data-types/timeseries/" >}})