Is it possible to manage update on a measure value in time series collection?

we have IOT devices (identified with the device_id field) that send multiple measure values with the same timestamp. We are using time series collection in mongoDB atlas 7.0.

We want to update the measure’s value of the document with the last value written on the collection but it seems that is not possible.

The only thing to do is first check if the document with the same device_id and timestamp is present in the time series collection, if it is present delete it and then insert the new one with the last value of the measurement.

This approach is very expensive for us, do you have any suggestions?