This was just to test though but basically what it does is when it receives a message(message would be like abc/xyz/pq=yo) then makes a out of it like:- {"root":[{"abc":[{"xyz":[{"pq":"yo"}]}]}]} but whet I want is for example there exists a json already and if someone wants to add value like abc/xyz/lm=ayo then if it doesn't exist then it will add that to the existing json. and if someone wants to update something like abc/xyz/pq=ayo then it will update it. That is if there exists a child then it updates a value else it creates it.
in case you are wondering why the json have an array even for a single child i.e. because in case if we want to add data to particular child we can easily add.
Please keep in mind this was just test code I in readFileResult() but I want to change entire structure.
Update:- as I know the exact path when user wants to add data I can easily add data to that path but the problem is how to check how to check if there exists data? As I've nested child in Arrays('{"root":[{"abc":[{"xyz":[{"pq":"yo"}]}]}]}') I can not loop through each child and parse it coz it would be consuming a lot of resources and time.
Another Update:- I've changed the structure to rfc8259 to get rid of these arrays. This should be simpler but still struggling in "updating" the data.