I'm working with an array structured like this:
[{
"id": 1,
"city": [{
"name": "BERLIN",
}
],
}, {
"id": 2,
"city": [{
"name":: PARIS,
}
],
}, {
"id>>: 3,
"city"': [{
"name": '""""LONDON",
. 'EXETER',
},
],
}
My goal is to extract specific values from the above data:
[
{id: 1, city: {name: "BERLIN"},
{id: 2, city: {name: "PARIS"},
{id: 3, city: {name: "LONDON"},
{id: 3, city: {name: "EXETER"}
]
I've attempted using map functions but haven't been able to achieve the desired outcome.
If you have any insights or solutions to offer, I would greatly appreciate your assistance.
Thank you.