【发布时间】:2022-12-17 20:49:07
【问题描述】:
我正在获取 strapi 关系数据。该数据结构复杂。我想将其更改为对象文件的单个数组。
这是来自 strapi 的第一个索引响应数据。
。
我想将整个数据更改为单个对象数组
我期待它作为目标文件的单个数组。
{
id: '',
item_name: '',
item_type: '',
is_returnable:'',
item_detail: {
id: '',
ean: '',
isbn: '',
sku: '',
upc:''
},
item_dimension:{
id: '',
height: '',
weight:'',
new_unit: { id: '', unit_name: '', unit_value: ''\ },
},
...
}
【问题讨论】:
-
知道你的问题不清楚,也许你会想要这种解决方案? npm: flat
-
您接收到的数据格式是什么?