Re:JSONiq: JSON Query Language
by masklinn on Tuesday November 09, 2021 @05:48AM
(#29159996)
Jq is xpath, this looks to be xquery. In fact it specifically works as an xquery embed.
[ Parent
| on HN ]
You can write the example below in jq as
def avg: add / length;
group_by(.url) | map({
"url": .[0].url,
"hits": length,
"avg": map(.response_time) | avg
})
so jq should be (at least roughly) as powerful as JSONiq.
Re:JSONiq: JSON Query Language
by emmanueloga_ on Tuesday November 09, 2021 @05:55AM
(#29160057)
... although, it seems neither JSONIq nor jq contain a "parent" operator, as far as I can tell.
Re:JSONiq: JSON Query Language
by lichtenberger on Tuesday November 09, 2021 @09:58AM
(#29162567)
This might be too restricting regarding the storage.
But we have a function: https://github.com/sirixdb/brackit