JSONiq: The JSON Query Language
JSONiq is a new query language that builds upon XQuery. Like SQL or LINQ, it has syntactic support concepts such as let, for, where, group by, and select. Here is an example:
let $stats := db:find("stats")
for $access in $stats
where $access("response_time") > 5
group by $url := $access("url")
return
{
"url": $url,
"avg": avg($access("response_time")),
"hits": count($access)
}
JSONiq supports than just JSON to JSON transformations. You can use it to generate or parse XML and even create queries that merge the two. In this example from the documentation, you can see JSONiq being used as a template language to generate HTML tables.

Like XQuery, JSONiq supports overlapping and non-overlapping windows. This feature is used for breaking data into evenly sized chunks or for statistical calculations such as “last 3” averages. You can learn more about tumbling and sliding windows in the XPath specification.
Another feature of JSONiq is the ability to update JSON data. In this example, you can see a status property being inserted into records that match the name "Deadbeat Jim".

JSONiq is available as part of the XQuery processor Zorba, which is distributed under Apache 2 License. JSONiq itself is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
MongoDB driver
by
William Candillon
You can try it live at 28.io/mongodb
Looks somewhat like XQuery
by
Faisal Waris
en.wikipedia.org/wiki/XQuery
Theoretically, How does this differ from Ember.js query model?
by
Guy Ndjeng
Technically I think it's a good initiative but in theory, how does this differ from Larger JS framework like Ember.js which provides a JSON query model that developers have adopted? The other question is how does this play with others?
Moreover, I am hearing that ECMAScript 5 will have an inherent mechanism for querying Javascript Objects which should address this problem..
Educational Content
Large-Scale Continuous Testing in the Cloud
John Penix May 24, 2013
Managing Build Jobs for Continuous Delivery
Martin Peston May 24, 2013
Clojure in the Field
Stuart Halloway May 23, 2013




Hello stranger!
You need to Register an InfoQ account or Login to post comments. But there's so much more behind being registered.Get the most out of the InfoQ experience.
Tell us what you think