I am working with an array of objects, each containing a nested object like the examples below.
[{
"-KzbaPS3vuZTG2LbuB3j": {
"age": "24",
"branchname": "columbia",
"city": "hyd",
"date": 1511418820987,
"gender": "M",
"id": "rcjcx8",
"mobile": "9898989898",
"name": "Patient1",
"op": 100
}
}, {
"-KzTh7RTtTWviL4HkHv0": {
"age": "21",
"branchname": "kims",
"city": "vizag",
"date": 1511334303070,
"gender": "F",
"id": "45krxb",
"mobile": "9898989898",
"name": "aruna",
"op": 100
},
"-KzTiCIheMPJIpJhPXQJ": {
"age": "22",
"branchname": "kims",
"city": "hyderabad",
"date": 1511420593865,
"gender": "F",
"id": "c7iqws",
"mobile": "9878787878",
"name": "vineesha",
"op": 100
},
"-KzTnzLnRsdFWg-m5b9U": {
"age": "26",
"branchname": "kims",
"city": "bheemavaram",
"date": 1511420593865,
"gender": "F",
"id": "ujtgz",
"mobile": "9876787898",
"name": "Madhavi",
"op": 100
}
}]
If the specific key for the nested object is unknown, how can all the objects within the objects be extracted and stored in an array?