How check context exist

I receive data but before updated I need check if data it's same or this object if exist or not
so if exist check is data if equal else update
or if not exist save it
example check object "V06-bus" exist or not
how that

With function node most simple case may be something like this

var stored = flow.get("stored")
// if stored object has not created yet, it is undefined
node.warn("check "+stored)
if(stored != msg.payload){
    // incoming data is not same as stored data
    node.warn("stroing "+msg.payload)   
    flow.set("stored", msg.payload)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.