I’m noob in mongoDB, you can find a mongoDB document example at the end.
I want to multiply the data.consumption by the value store in the object coef according the metadata.sensorId.
In the example the metadata.sensorId is “SENSOR_32”, so the coef we want to multiply is 1.2.
How can i do it.
{
"metadata": {
"sensorId": "SENSOR_32"
},
"data": {
"consumption": 3.547,
"powerOutput": 21.282
},
"coef": {
"SENSOR_32": 1.2,
"SENSOR_33": 1.32,
"SENSOR_34": 1.62,
"SENSOR_35": 2.3,
"SENSOR_36": 2.47,
"SENSOR_37": 2.46,
"SENSOR_38": 1.62
}
}