{
"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