I need to find and update json object from nested json object. Consider the original json object.
var originaldata=[
{
"sc_iden": "331",
"sc_name": "Scene 1",
"sc_type": "",
"sc_status": "Draft",
"sc_owner": "",
"children": [
{
"sc_iden": "332",
"Sc_name": "Scene1.1",
"sc_type": "",
"sc_status": "Draft",
"sc_priority": "3",
"sc_owner": "",
"children": []
}
]
},
{
"sc_iden": "334",
"sc_name": "Scene2",
"sc_type": "",
"sc_status": "Draft",
"sc_priority": "2",
"sc_owner": "",
"children": []
}]
Find the below findUpdate record from originaldata(JSON) and update their values.
var findUpdate = {
"sc_iden": "332",
"Sc_name": "My Scene",
"sc_type": "New Type",
"sc_status": "Opened",
"sc_priority": "5",
"sc_owner": "Admin",
"children": []
}
Based on sc_iden ="332" search the originaldata and update new values(findUpdate) by using jquery or angularjs.