Combine several messages from MQTT into one request to DataBase

for storing it in one object, i do this...

MQTT (topic/subtopic/#) --> function node

var val = msg.payload;                    // get the value
var key = msg.topic;                      //get the topic
var mqttData= flow.get("mqttData") || {}; //get the store object
mqttData[key] = val;                      // add/update the value
flow.set("mqttData", mqttData);           // save to flow context