我有一个带有嵌套字段的JSON:
[
{
"Platform Parent Dato Id": "23768",
"Platform Dato Id": "24138",
"Platform Dato Name": "Random Europe",
"Platform mission Id": "111112",
"Platform submission Id": "638687",
"Platform submission Flight Id": "863524",
"Start Date": "2017-12-01",
"End Date": "2017-12-02",
"Platform Compensation": 109.0909,
"Total Value": 909.0909,
"Goal": "200000.0000",
"Value Information": {
"Platform Compensation": [
{
"Platform mission Id": "111112",
"Platform submission Id": "638687",
"Platform submission Flight Id": "863524",
"Value Rate": "14.0000",
"Value": 109.0909
}
]
}
},
{
"Platform Parent Dato Id": "23768",
"Platform Dato Id": "24138",
"Platform Dato Name": "Random Europe",
"Platform mission Id": "111113",
"Platform submission Id": "638687",
"Platform submission Flight Id": "863524",
"Start Date": "2017-12-01",
"End Date": "2017-12-02",
"Platform Compensation": 109.0909,
"Total Value": 909.0909,
"Goal": "200000.0000",
"Value Information": {
"Platform Compensation": [
{
"Platform mission Id": "111113",
"Platform submission Id": "638687",
"Platform submission Flight Id": "863524",
"Value Rate": "12.0000",
"Value": 109.0909
}
]
}
}
]
我正在使用JSONPATH从“Value Information”嵌套中获取“Value Rate”。我已将我的JSON文本粘贴到此网站:http://jsonpath.com/,并使用以下代码行:
$[*].['Platform Compensation'].['Value Rate']
我得到了这个:
使用以下代码后:
$.['Value Information'].['Platform Compensation'].['Platform mission Id']
我得到了这个: 我试图返回的(输出)是下面这个: 但我无法找到正确的语法来将这两个组合在一行中,并使用一个JSONPATH查询同时返回两个内容。