# How to delete data from influxdb2 with node red

**URL:** <https://discourse.nodered.org/t/how-to-delete-data-from-influxdb2-with-node-red/83007>\
**Category:** General\
**Tags:** influxdb\
**Created:** [19 November 2023 09:50 UTC](https://discourse.nodered.org/t/how-to-delete-data-from-influxdb2-with-node-red/83007 "2023-11-19T09:50:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![88bit](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/88bit/32/79334_2.png) [@88bit](https://discourse.nodered.org/u/88bit)\
**Post date:** [19 November 2023 09:50 UTC](https://discourse.nodered.org/t/how-to-delete-data-from-influxdb2-with-node-red/83007/1 "2023-11-19T09:50:15Z")

</div>

Hi all, I’m trying to delete records from a influxdb and I can’t find anything about this anywhere. I have found some possibilities using the http API but I have no idea how to implement this in Node Red.  
Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 November 2023 10:09 UTC](https://discourse.nodered.org/t/how-to-delete-data-from-influxdb2-with-node-red/83007/2 "2023-11-19T10:09:06Z")

</div>

Is this a one off requirement or do you need to do it regularly?

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [19 November 2023 10:39 UTC](https://discourse.nodered.org/t/how-to-delete-data-from-influxdb2-with-node-red/83007/3 "2023-11-19T10:39:20Z")

</div>

If you copy the data into a new table using WHERE to filter out the unwanted data, you can then delete the original table and rename the new table to the old table name.

---

<div class="post-metadata">

**Author:** ![88bit](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/88bit/32/79334_2.png) [@88bit](https://discourse.nodered.org/u/88bit)\
**Post date:** [19 November 2023 11:32 UTC](https://discourse.nodered.org/t/how-to-delete-data-from-influxdb2-with-node-red/83007/4 "2023-11-19T11:32:42Z")

</div>

Ii have a mapping application on which I plot sensors. After some time the sensors die and I need to remove them from the map. So yes it’s regularly I would need that functionality. I also could have a status change from good to bad and then don’t list them any more but it would be nice if I can delete them. There also maybe user error inputs which would be nice to delete the records.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 November 2023 11:56 UTC](https://discourse.nodered.org/t/how-to-delete-data-from-influxdb2-with-node-red/83007/5 "2023-11-19T11:56:02Z")

</div>

Do you know about the Retention Policy feature of influx which allows you to say that data should be deleted after it is a certain age? If you are not interested in data from more than a certain time ago you can use that.

Alternatively you can do it from the command line or using the api. [Delete data | InfluxDB OSS v2 Documentation](https://docs.influxdata.com/influxdb/v2/write-data/delete-data/)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 January 2024 11:56 UTC](https://discourse.nodered.org/t/how-to-delete-data-from-influxdb2-with-node-red/83007/6 "2024-01-18T11:56:15Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
