Слияние кода завершено, страница обновится автоматически
Продолжение вопроса: https://gitee.com/noear/snack3/issues/IBGNQ4
String json = """
{
"store": {
"book": [
{
"category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the Century",
"price": 8.95
},
{
"category": "reference 19.95",
"author": "Nigel Rees 19.95",
"title": "Sayings of the Century 19.95",
"price": 19.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
}
""";
// Проблема 1: повторение данных price
System.out.println(ONode.load(json).select("$..*[?(@.price == '19.95')]"));
// Проблема 2: в выражении "$..*[?(@ == '19.95')]" уже "$.." указывает на бесконечную рекурсию уровней, а необходимость "$..*"?
// По факту, "$..[?(@ == '19.95')]" не возвращает никаких данных