Very specific question, if I have the following input in my Streaming Analytics component:
//some input
"outputs": [
{
"name": "output1",
"unit": "unit1",
"value": "95813"
},
{
"name": "output2",
"unit": "unit2",
"value": "303883"
}, // and more array values
How can I get a JSON result that would look as follows:
"outputs":[ {
"output1":95813,
"output2":303883
//etc
}]
So, I don't need the unit value, and to save space, I'd like to use the 'name' as the key, and the 'value' as the value of the key-value array. This is my current query:
SELECT
input.outputs as outputs
INTO "to-mongodb"
FROM "from-iothub" input
but this of course creates seperate JSON arrays, with the same structure as I do get as my input.
Anyone any idea on how to do this?
In worst case, just filtering out the 'unit' would also already be a great help.
Thanks in advance
