I am connected to websocket using node.js. Every few sec i get message from websocket with some json data.
Something like this :
{"event":"add","data":[
{"id":["12280965172"],"m":"Marko","e":"FA","u":"pn1","p":98.72}},
{"id":["12280964541"],"m":"Darko","e":"FA","u":"kk6","p":1.02}},
{"id":["12280965661"],"m":"Ivan","e":"FB","u":"jb1","p":0.23}}
]}
When i get this message i want to save it into "example.json" on localhost.
"example.json" is already existing file. Before i add this new data I want to see if i already have data with same "m" in "example.json" and if not i want to add it.
What would be the best way to do it ?