是否有等效于 XQuery/XPath 的 JSON? [英] Is there a JSON equivalent of XQuery/XPath?
本文介绍了是否有等效于 XQuery/XPath 的 JSON?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在复杂的 JSON 数组和哈希中搜索项目时,例如:
<预><代码>[{ "id": 1, "name": "One", "objects": [{ "id": 1, "name": "Response 1", "objects": [//等等.}]}]是否有某种查询语言可以用来在 [0].objects where id = 3 中查找项目 ?
解决方案
是的,它叫做 JSONPath:
它还集成到 DOJO 中.
When searching for items in complex JSON arrays and hashes, like:
[
{ "id": 1, "name": "One", "objects": [
{ "id": 1, "name": "Response 1", "objects": [
// etc.
}]
}
]
Is there some kind of query language I can used to find an item in [0].objects where id = 3
?
解决方案
Yup, it's called JSONPath:
It's also integrated into DOJO.
这篇关于是否有等效于 XQuery/XPath 的 JSON?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文