Json查询String以获取Condition的值

时间:2018-05-14 10:28:53

标签: java json json-query

我想获得vehicleCode vehicleLeaseAS PER LAW OF ENFORCMENT的{​​{1}}元素的值。

有人可以帮我解决JSON查询吗?

请在下面找到JSON数据。

    {
    "StateOffers": [
        [{
                "vehicleCode": 242214214,
                "vehiclePart": [{
                        "@type": "vehiclePart",
                        "segments": [{
                                "@type": "Segment"
                                "segmentOfferInformation": {
                                    "vehicleMiles": 771,
                                    "awardFare": false
                                },
                                "vehicleLease": "AS PER LAW OF ENFORCMENT"
                            }
                        ],
                        "stops": 0
                    }
                ]
            }, {
                "vehicleCode": 242214214,
                "vehiclePart": [{
                        "@type": "vehiclePart",
                        "segments": [{
                                "@type": "Segment"
                                "segmentOfferInformation": {
                                    "vehicleMiles": 771,
                                    "awardFare": false
                                },
                                "vehicleLease": "MY RULE MY WORLD"
                            }
                        ],
                        "stops": 0
                    }
                ]
            }
        ]
    ]
 }

这是我试过的表达方式:

$..vehicleCode[?($..vehicleLease=="AS PER LAW OF ENFORCMENT")

0 个答案:

没有答案