I have a json like this:
{
"name": "Team Wolf",
"www": "http://www.teamwolf.qqq",
"department": "department1",
"team1": "team1"
},
{
"name": "Team Fox",
"www": "http://www.teamfox.qqq",
"department": "department1",
"team2": "team2"
},
{
"name": "Team Falcon",
"www": "http://www.teamfalcon.qqq",
"department": "department1",
"team3": "team3"
}
And I need to transform it in a json structured like this:
'department1': {
'team1': {
'name':'Team Wolf',
'www': 'http://www.teamwolf.qqq'
},
'team2': {
'name':'Team Fox',
'www': 'http://www.teamfox.qqq'
},
'team3': {
'label':'Team Falcon',
'www': 'http://www.teamfalcon.qqq'
}
In simple terms, I need to group the data by 'department1'. Any suggestions would be much appreciated.