我使用的 REST API 返回此数据格式:
const documents = [
{
"fields": {
"title": {
"stringValue": "77"
},
"difficulty": {
"doubleValue": 77
},
},
"createTime": "2020-04-10T15:13:47.074204Z"
},
{
"fields": {
"title": {
"stringValue": "99"
},
"difficulty": {
"doubleValue": 99
},
},
"createTime": "2020-04-10T15:13:47.074204Z"
}
]
我需要的是这种格式:
{
title: "77",
difficulty: 77
},
{
title: "99",
difficulty: 99
}
这意味着我不仅要对这些数据进行分组,还要完全删除中间的两层。我怎么做?
作为奖励:我如何在这方面做得更好?有什么好的资源吗?