How can i delete all data stored like flow.set("xy",value)


#1

hello,
i collect data by mqtt topic.
so i count something in flow.set(msg.topic,flow.get(msg.topic)+1)
this data i push into a chart.
but how can i remove all in flow. ?
i will reset the data stored in flow. each day with the rbe node that it will count from 0.


#2

just use flow set to set it to null or 0


#3

my problem is i have multiple keys, i will remove all key,value pairs.

i found this solution but the keys are still there.

i missing flow.clear()

var keys = flow.keys();
for (index = 0; index < keys.length; ++index) {
flow.set(keys[index],null);
}


#4

flow.set(keys[index]);

:wink:


#5

or you should be able to delete it totally with a change node set to delete


#6

thanks, this syntax seems to remove it.