是否有与 XQuery/XPath 等效的 JSON?

2022-01-31 00:00:00 xpath json javascript xquery

在复杂的 JSON 数组和哈希中搜索项目时,例如:

When searching for items in complex JSON arrays and hashes, like:

[
    { "id": 1, "name": "One", "objects": [
        { "id": 1, "name": "Response 1", "objects": [
            // etc.
        }]
    }
]

是否有某种查询语言可用于在 [0].objects where id = 3 中查找项目 ?

Is there some kind of query language I can used to find an item in [0].objects where id = 3?

推荐答案

是的,它叫做 JSONPath:

它还集成到 DOJO 中.

相关文章