Need some JSON help. I'm working with JSON similar to this:
{
GreatGrandfather: {
GrandFather: {
Father: [
{
Son: [
{
Name: "Abu Nazir",
Detail: {
Class: "3rd Grade"
}
},
{
Name: "Dexter",
Detail: {
Class: "6th Grade"
}
},
{
Name: "Rick",
Detail: {
Class: "11th Grade"
}
}
]
},
{
Son: [
{
Name: "Tom Walker",
Detail: {
Class: "3rd Grade"
}
},
{
Name: "Sgt Bastisa",
Detail: {
Class: "6th Grade"
}
},
{
Name: "The Governer",
Detail: {
Class: "11th Grade"
}
}
]
}
]
}
}
}
My question is how do I delete the Sons that have the Class value of "3rd Grade"? So both Abu Nazir and Tom Walker will be deleted and each father will have only 2 sons?
Also, how would I add Sons to both fathers?
{Name: "Stewie",Detail: {Class:"Kindergarden"}}
and
{Name: "Peter",Detail: {Class:"1st Grade"}}
Thanks!