I believe that's a pretty basic question but I can't sort it out :
Given the following array :
[
{
"TimeStamp":"2022-03-29T10:15:00.000Z",
"Name":"SN: 2001680707",
"Type":"SB 3300",
"Serial":2001680707,
"TotalYield":228433,
"Power":600,
"PVOutput":1
},
{
"TimeStamp":"2022-03-29T10:10:00.000Z",
"Name":"SN: 2001680707",
"Type":"SB 3300",
"Serial":2001680707,
"TotalYield":228383,
"Power":636,
"PVOutput":1
}
]
I would like to create an array of object from it containing only the TimeStamp and Power keys/values :
[
{
"TimeStamp" : "2022-03-29T10:15:00.000Z",
"Power" : 600
},
{
"TimeStamp" : "2022-03-29T10:10:00.000Z",
"Power" : 636
}
]
I particularly love Sonata which I find very elegant, but a function would suit as well
Thanks for your help,
Matthieu