Hi there.
I’m using time-series collection to store the measurements of a sensor.
I have a collection in which I store the avarage values of one hour of measuraments.
In order to valorized the current hour I insert every 10 minutes a temporary row with the partial values. My Meta is an object and one of its properties is “bool TemporaryTimeSeries”. When TemporaryTimeSeries is true the time-series with the partial values will be deleted by the logic of the program. I do not perform an update because I can’t update values or time stamp of a time-series. To reach the same result I delete the temporary time series that will be replaced with the updated one. Once the hour change i perform an update on the time-series with TemporaryTimeSeries at true, setting it to false.
Here an example of a time-series that i am working with
{
"Value": 5.3,
"TimeStamp": "2023-08-22T12:34:56Z",
"Meta": {
"DeviceId": "ID123",
"SensorId": "Sensor456",
"TemporaryTimeSeries": true
}
}
The problem is that when I update TsTemporary to false MongoDb does not update the buckets structures even if the Meta is the same.
What happen is that I have different buckets with the same Meta.
That’s lead me to have as many bucket as the time-series that i collected.
Is this behavior fixable?
If not what can i do?
Thanks