Is there a query language for JSON? Is there a query language for JSON? json json

Is there a query language for JSON?


Sure, how about:

They all seem to be a bit work in progress, but work to some degree. They are also similar to XPath and XQuery conceptually; even though XML and JSON have different conceptual models (hierarchic vs object/struct).

EDIT Sep-2015: Actually there is now JSON Pointer standard that allows very simple and efficient traversal of JSON content. It is not only formally specified, but also supported by many JSON libraries. So I would call it actual real useful standard, although due to its limited expressiveness it may or may not be considered Query Language per se.


I'd recommend my project I'm working on called jLinq. I'm looking for feedback so I'd be interested in hearing what you think.

If lets you write queries similar to how you would in LINQ...

var results = jLinq.from(records.users)    //you can join records    .join(records.locations, "location", "locationId", "id")    //write queries on the data    .startsWith("firstname", "j")    .or("k") //automatically remembers field and command names    //even query joined items    .equals("location.state", "TX")    //and even do custom selections    .select(function(rec) {        return {            fullname : rec.firstname + " " + rec.lastname,            city : rec.location.city,            ageInTenYears : (rec.age + 10)        };    });

It's fully extensible too!

The documentation is still in progress, but you can still try it online.


Update: XQuery 3.1 can query either XML or JSON - or both together. And XPath 3.1 can too.

The list is growing: