多个子节点的jsonNodeReference和jsonPathDefinition。 [英] jsonNodeReference and jsonPathDefinition for multiple child nodes.

查看:73
本文介绍了多个子节点的jsonNodeReference和jsonPathDefinition。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个格式的Json文件。

I have a Json file in the format.

{

    "成功":真实,

    "个人资料":[

        {

            "id":"123","
            "数据":[

                {

                    "date":""2018-11-08T00:00:00",

                    " name":" sree",$
    "数量":""10"&
},

{

                    "date":""2018-11-09T00:00:00",

                    " name":" sree",$
    "数量":""20"&
}

]

},

{

            "id":"154","
            "数据":[

                {

                    "date":""2018-11-08T00:00:00",

                    "name":"Dhanu","
     "" Quantity":" 25" b
},

{

                    "date":""2018-11-09T00:00:00",

                    "name":"Dhanu","
    "数量":""29"&
}

    ]¥b $ b }

   ]

}

{
    "success": true,
    "profiles": [
        {
            "id": "123",
            "data": [
                {
                    "date": "2018-11-08T00:00:00",
                    "name": "sree",
    "Quantity": "10"
},
{
                    "date": "2018-11-09T00:00:00",
                    "name": "sree",
    "Quantity": "20"
}
]
},
{
            "id": "154",
            "data": [
                {
                    "date": "2018-11-08T00:00:00",
                    "name": "Dhanu",
     "Quantity": "25"
},
{
                    "date": "2018-11-09T00:00:00",
                    "name": "Dhanu",
    "Quantity": "29"
}
    ]
}
   ]
}

我想从文件中提取数据并加载到Azure表格中以下结构

I want to pull the data from the file and load into Azure table for with below structure

 

我试过 

" jsonNodeReference"
" $。['个人资料'] ['数据']"

但它没有给我预期的输出。

But it is not giving me the output expected.

任何帮助将不胜感激。 

Any help will be appreciated. 

推荐答案

嗨Sreeprasad,

Hi Sreeprasad,

从您期望的输出中,您需要迭代并提取两个json对象:'profiles'和'data',而 jsonNodeReference 仅支持指定要迭代的一个对象。所以我担心你预期的输出不是现在可以实现的
。 

From the output you expected, you need to iterate and extract two json objects : 'profiles' and 'data', while jsonNodeReference only supports on specifying one object to iterate on. So I'm afraid the output you expected is not achievable right now. 

下面的数据集json定义是一种解决方法,它给出了如下输出:

The below dataset json definition is a workaround for you, it gives output like:

{
    "name": "AzureBlob2",
    "properties": {
        "linkedServiceName": {
            "referenceName": "azurestorage1",
            "type": "LinkedServiceReference"
        },
        "type": "AzureBlob",
        "typeProperties": {
            "format": {
                "type": "JsonFormat",
                "filePattern": "setOfObjects",
                "jsonNodeReference": "


。['profiles'] [*]。 ['data']",
" jsonPathDefinition":{
" Success":"
.['profiles'][*].['data']", "jsonPathDefinition": { "Success": "


。['success']",
"Id":"
.['success']", "Id": "


这篇关于多个子节点的jsonNodeReference和jsonPathDefinition。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆