Being a newcomer to javascript, I am struggling with breaking down a complex structure into an array.
The current structure is as follows:
[
{
"Key": "ProducePRINKA0370001",
"Record": {
"docType": "Produce",
"PRODUCEID": "PRINKA0370001"
}
},
{
"Key": "ProducePRINKA0370038",
"Record": {
"docType": "Produce",
"PRODUCEID": "PRINKA0370038"
}
},
{
"Key": "ProducePRINKA0370050",
"Record": {
"docType": "Produce",
"PRODUCEID": "PRINKA0370050"
}
}
]
I need to transform this structure into the desired array format below:
[
{
"docType": "Produce",
"PRODUCEID": "PRINKA0370051"
},
{
"docType": "Produce",
"PRODUCEID": "PRINKA0370038"
}
]
I have attempted various methods but haven't been successful. Any assistance would be greatly appreciated.
Thank you in advance.