{
"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": 19.95
}
},
"expensive": 10
}
我想通過以下條件
$..[?(@.price == 12.99 && @.title == 'Moby Dick')]
應該有retrivd我要檢查的對象樣本JSON如圖所示下面。但是,它只顯示[]。
{
"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
},
任何關於查詢中錯誤的指針?
我試圖建立一個IF-THEN語句。其中,如果他們都在那裏,做點什麼? – Betafish
我的答案產生的結果你的問題說你想。你想問一個不同的問題嗎?如果是這樣,請開一個新的問題。 – cybersam
可能是我第一次不清楚。我現在修改了查詢。你能看到我在這種情況下如何改變查詢。 – Betafish