The idea here would be to group these values into periods of 15 minutes. But i'm not even completely sure where to start with the aggregators, in fact, since this are all a single MongoDb entity i'm not even sure if aggregators are the best way to go at this.
All the data needed for a single day is within the "value" key.
{
"_id": {
"$oid": "63a1d8cfcf1a43844d68ca0a"
},
"date": "2022-01-01",
"values": [
{
"timestamp": "2022-01-01T00:00:00",
"meterValue": "6",
"locationID": "LIS-00001"
},
{
"timestamp": "2022-01-01T00:05:00",
"meterValue": "20",
"locationID": "LIS-00001"
},
{
"timestamp": "2022-01-01T00:10:00",
"meterValue": "13",
"locationID": "LIS-00001"
},
{
"timestamp": "2022-01-01T00:15:00",
"meterValue": "4",
"locationID": "LIS-00001"
},
{
"timestamp": "2022-01-01T00:20:00",
"meterValue": "11",
"locationID": "LIS-00001"
},
{
"timestamp": "2022-01-01T00:25:00",
"meterValue": "5",
"locationID": "LIS-00001"
},
{
"timestamp": "2022-01-01T00:30:00",
"meterValue": "3",
"locationID": "LIS-00001"
},
{
"timestamp": "2022-01-01T00:35:00",
"meterValue": "16",
"locationID": "LIS-00001"
},
{
"timestamp": "2022-01-01T00:40:00",
"meterValue": "1",
"locationID": "LIS-00001"
},
{
"timestamp": "2022-01-01T00:45:00",
"meterValue": "0",
"locationID": "LIS-00001"
},...
]
}
This would output something like:
{
"date: "2022-01-01T00:15:00",
"meterValueSum": 39
},
{
"date": "2022-01-01T00:30:00",
"meterValueSum": 20
},
{
"date": "2022-01-01T00:45:00",
"meterValueSum": 20
},...