I have some documents that I imagine like those:
{
timestamp: "2017-11-12T00:00:00",
samples: [
{
param: "Temperature",
value: 76.3
},
{
param: "Pressure",
value: 12.3
}
]
}
I'd like to plot temperature vs pressure. and even better, aggregate the temperature for pressure ranges (avg for pressure between 0-5, 5-10, 10-15, tc...) How can I do this?
I could have done this:
{
timestamp: "2017-11-12T00:00:00",
"Temperature": 76.3
"Pressure": 12.3
}
but it is not really convenient because
- I can have thousands of fields like temperature or pressure
- I don't know the name of parameters a priori, therefore I cannot figure out how to make the mappings before inserting.
Any suggestion?