I would like to fetch only the selected attributes from an array and selected attributes from another array inside the first one.
Below is the data sample:
{
"id": "transCodes_HNLWS",
"lastUpdBy": "1200",
"version": "1.3",
"docType": "transCodes",
"cds": [
{
"mealCdPrmpt": false,
"subTrans": [
{
"entryType": false,
"alSubDept": 22,
"prmptl": false,
"descript": "Subdept description"
"subDept": 1
}
],
"dept": 73,
"descript": "Dept description",
}
]
}
The data that I want would look like:
{
"id": "transCodes_HNLWS",
"cds": [
{
"dept": 73,
"subTrans": [
{
"entryType": false,
"subDept": 1
}
]
}
]
}
Please suggest