I want convert flat-Json to hierarchical, or I'm converting excel to Json first and then try to make JSON Object hierarchy. I want convert flat-Json to hierarchical json object of nth level.
Is there any middleware that conver Flat JSON to hirerachy JSON object.
{ "Name": "SAM", "Department": "CO", "Year": "2018"},
{ "Name": "SAM", "Address": "Mumbai", "Type": "Permanent"},
{ "Name": "John", "Department": "CE", "Year": "2018" },
{ "Name": "John", "Address": "Delhi", "Type": "Permanent" }
Expected Out-Put:
[{
"Name" : "SAM",
"Department": "CO",
"Year": "2018"
"children" : [{
"Name": "SAM",
"Address": "Mumbai",
"Type": "Permanent"
}]
},
{
"Name" : "John",
"Department": "CE",
"Year": "2018"
"children" : [{
"Name": "John",
"Address": "Delhi",
"Type": "Permanent"
}]
}]