我有两个json对象,它们来自我需要合并它们的两个分离的数据库。
Json1:来自产品数据库
1[{"prod": "Product1", "price": 12.99, "stock": 243, "description": "prod1 description"}]
Json2:来自评论数据库
1[{"reviewer": "reviwerX", "review": "this is review from X"},
{"reviewer": "reviwerY", "review": "this is review from Y"},
{"reviewer": "reviwerZ", "review": "this is review from Z"}]
我需要使用VB合并这些,以便我得到:
product[{"prod": "Product1",
"price": 12.99,
"stock": 243,
"description": "prod1 description",
"reviews" :[
{"reviewer": "reviwerX", "review": "this is review from X"},
{"reviewer": "reviwerY", "review": "this is review from Y"},
{"reviewer": "reviwerZ", "review": "this is review from Z"}]}]
我无法找到这样做的例子。我发现有很多例子可以将json对象与相同的数据字段合并(连接),但不能按照我需要的方式嵌套对象。