I want to insert the detail array
in the data array
under specific areas.
For instance, the value of the bdh
key in the detail array
should be placed in the bdh
key of the data array
, replacing the empty array that is there to begin with. Similarly, the value of the hadoop
key in the detail array
should replace the empty array that the hadoop
key in the data array
currently has. This replacement should happen for every key in the details
array.
How do I accomplish this?
Data array
{"data":
{
"categories":
{
"articles":
{
"bdh":[],
"hadoop":[]
},
"videos":
{
"bdh Videos":[],
"hadoop Videos":[]
}
}
}
}
Detail array
{"details":{
"bdh":
[
{"id":1, "name":"bdh article 1", "body":"this is bdh article 1 body."},
{"id":2, "name":"bdh article 2", "body":"this is bdh article 2 body."}
],
"hadoop":
[
{"id":3, "name":"hadoop article 1", "body":"this is hadoop article 1 body."},
{"id":4, "name":"hadoop article 2", "body":"this is hadoop article 2 body."}
],
"bdh Videos":
[
{"id":5, "name":"bdh videos 1", "body":"this is bdh videos 1 body."},
{"id":6, "name":"bdh videos 2", "body":"this is bdh videos 2 body."}
],
"hadoop Videos":
[
{"id":7, "name":"hadoop videos 1", "body":"this is hadoop videos 1 body."},
{"id":8, "name":"hadoop videos 2", "body":"this is hadoop videos 2 body."}
]
}