合并(嵌套)两个json对象VB

时间:2016-03-15 11:48:29

标签: json vb.net

我有两个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对象与相同的数据字段合并(连接),但不能按照我需要的方式嵌套对象。

0 个答案:

没有答案