【发布时间】:2021-06-22 09:18:26
【问题描述】:
{
"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
}
]
}
}
以下是我的情况: author=='Nigel Rees'.price
我的查询表达式:$.store.book[?($.store.book[?(@.author == 'Nigel Rees')].price < $.store.book[?(@.author == 'Evelyn Waugh')].price)]
我希望它会返回以下结果:
{
"category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the Century",
"price": 8.95
}
正确的表达方式是什么?
【问题讨论】: