JSONQuery, New API in CloudKit jQuery Plugin
Upcoming  JSONQuery support was recently announced for CloudKit and there is now good news to share about the progress.
A No-Dependency JSONQuery Library for JavaScript
Thanks to Kris Zyp and Jason Smith, a no-dependency JavaScript library for JSONQuery is available on GitHub. I am maintaining my own fork of this library with bug fixes and a large set of tests. If you’ve been curious about JSONQuery but wanted some concrete examples of usage, there are now over 300 lines of tests and examples to browse on my GitHub fork.
JSONQuery in the CloudKit jQuery Plugin
The latest version of the jQuery plugin for CloudKit now supports JSONQuery and includes an improved API. The original version of the plugin used TaffyDB. While TaffyDB is a quality library, the promise of a standard querying mechanism for JSON via JSONQuery was too powerful to ignore.
jQuery.data Inside
Under the hood, jquery.cloudkit.js uses jQuery.data as its local in-browser store now that TaffyDB is no longer required. jQuery.data is nothing new, but for those unfamiliar, the quick summary is that it provides a key/value store that can be attached to any DOM element.
This is useful in the case of CloudKit where a top-level store for each resource collection is attached to the window element.
The New API
The basics of setting up your local in-browser database mapped to a CloudKit service are the same; you can still point the library at the metadata URL and it will configure and load itself. Each RESTful collection in CloudKit is still exposed as its own store. Beyond this, the API has been altered to provide a better interface, delegating work to the resources themselves instead of filtering all work through the outer collection. This new philosophy more closely matches that of CloudKit::Resource on the server.
Here are some examples from the README:
JSONQuery in CloudKit
On the server side, things are moving quickly thanks to Johnson, a JavaScript bridge for Ruby. Johnson vendors SpiderMonkey to perform its work which means the exact same query API that is available in your browser is also available in CloudKit. Interested hackers can build a current gem for Johnson and use it with the jsonquery branch of CloudKit on GitHub today. These updates will be merged into the master branch for the next release.