Update influxdb measurements

#1

hi,
I am a beginner of influxdb and I want information.Is it possible update of the measurements??

#2

removed because paste went wrong and noah* was also writing an answer :slight_smile:

#3

Hi @spartacus901,

Can you write a little more about what you’re hoping to accomplish? What do you mean by “update of the measurements?” Do you have a specific use case in mind?

In general, time series data is composed of measurements taken at various point in time. It would be unusual to change the value of a measurement after it was taken. If you record the temperature in a room at 10:00am, for example, that value would remain static.

If you want to change the tags for a measurement, it usually makes sense to create a new series with the updated information and then drop the original series.

#4

It’s unusual to want to update a measurement but not unknown.
For example, what if the device which is supplying the measurement has a bug?
That happened here recently - a firmware update to out monitoring device inadvertently swapped two fields’ data before uploading. The issue was quickly fixed once it was noticed but it meant our Influx database had bad values for a few hours’ worth of measurements.

To answer the question, you can simply overwrite the existing measurement with the correct values.

However if your initial data includes bad field names you are out of luck; there is no way to erase or hide individual fields in an Influx database.

#5

While it’s technically true that you can overwrite the existing measurement, it’s important to understand the particular use case when someone asks whether they can update data in InfluxDB.

When many users ask that question, they are thinking about it in the context of a relational database and CRUD operations, where updates are frequent, and for which InfluxDB is not well suited.

Repairing data caused by a firmware issue causing fields to be swapped is a one-time replacement of the data in storage; once that is done, the data generally won’t be changed again.