我有成千上万这样的文件:
{
country:"ES",
month: 4,
cars: [
{
name: "audi a5",
doors: 1,
PRICE: 40
},
{
name: "audi a6",
doors: 3,
PRICE: 100
},
]
}
将它们转换为另一种形式的最佳方法是什么:
[
{
name:"audi a5",
doors: 1,
prices:[
{month:4,country:"ES",price:40},
{month:5,country:"ES",price:44},
....
]
},
{
name:"audi a6",
doors: 3,
prices:[
{month:4,country:"ES",price:100},
{month:5,country:"ES",price:120},
....
]
},
]
我尝试了列表功能,但没有成功。可能是它试图编译的元素太多。每个原始文档包含大约 20 辆汽车。总共有大约200辆汽车。100 个国家和 12 个月。