使用JsonPath我通過這個文件去一個JSON場的最大值: https://github.com/jayway/JsonPath發現在Java中
但我無法弄清楚如何找到一個特定領域的最大值。 在給定的json中,如果我想知道最昂貴的書的價格怎麼辦?
這裏是JSON:
{
"store": {
"book": [
{
"category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the Century",
"price": 8.95
},
{
"category": "fiction",
"author": "Evelyn Waugh",
"title": "Sword of Honour",
"price": 12.99
},
{
"category": "fiction",
"author": "Herman Melville",
"title": "Moby Dick",
"isbn": "0-553-21311-3",
"price": 8.99
},
{
"category": "fiction",
"author": "J. R. R. Tolkien",
"title": "The Lord of the Rings",
"isbn": "0-395-19395-8",
"price": 22.99
}
],
"bicycle": {
"color": "red",
"price": 29.95
}
},
"expensive": 10
}
會是什麼jsonpath表達(在Java中)找到了最大的價格爲一本書。這裏的答案應該是22.99。