我只想使用 jsonpath 提取特定值
I want to extract only a specific value using jsonpath
如何使用 jsonpath 从 Json 中仅提取 id 值,如下所示?
[
{
"Name": "Test",
"Code": "00",
"options": [ {
"id": "SS111",
"roundTrip": false,
"price": 53900,
"trains": [ {
"packageDiscount": 3244,
"goodsType": "REGULAR"
}],
"adults": 1
}],
"type": "DOMESTIC_TRAIN"
},
{
"Name": "Test",
"Code": "00",
"options": [ {
"id": "SS222",
"roundTrip": false,
"price": 53900,
"trains": [ {
"packageDiscount": 3244,
"goodsType": "REGULAR"
}],
"adults": 1
}],
"type": "DOMESTIC_TRAIN"
}
]
我想要的结果如下
SS111,
SS222
请告诉我 Jsonpath.Please 请告诉我 Jsonpath.Please 请告诉我 Jsonpath.Please 请告诉我 Jsonpath.Please 请告诉我 Jsonpath.
使用..
- Deep Scan operator
$..id
如何使用 jsonpath 从 Json 中仅提取 id 值,如下所示?
[
{
"Name": "Test",
"Code": "00",
"options": [ {
"id": "SS111",
"roundTrip": false,
"price": 53900,
"trains": [ {
"packageDiscount": 3244,
"goodsType": "REGULAR"
}],
"adults": 1
}],
"type": "DOMESTIC_TRAIN"
},
{
"Name": "Test",
"Code": "00",
"options": [ {
"id": "SS222",
"roundTrip": false,
"price": 53900,
"trains": [ {
"packageDiscount": 3244,
"goodsType": "REGULAR"
}],
"adults": 1
}],
"type": "DOMESTIC_TRAIN"
}
]
我想要的结果如下
SS111,
SS222
请告诉我 Jsonpath.Please 请告诉我 Jsonpath.Please 请告诉我 Jsonpath.Please 请告诉我 Jsonpath.Please 请告诉我 Jsonpath.
使用..
- Deep Scan operator
$..id