![]() I haven't tested but you could probably nest filters too for querying inner collections. ![]() You can put as many conditions inside the delegate as you can imagine: simple comparison, startsWith, etc. The built-in array.filter() method makes most of these so-called javascript query libraries obsolete Here are some illustrations based on the original question, which gave this JSON as an example: [. The C-based implementation of jq is generally known as "jq", and the Go-based version as "gojq". ) and even available in the browser via jq-web. Jq is a JSON query language, mainly intended for the command-line but with bindings to a wide range of programming languages (Java, node.js, php. People.name | | join(', ', are plenty more live examples you can play with in the docs. Join expressions together to sort and join elements into a string Select only the name and age of people over 35 Select all first names based on search term ![]() It is being used by Amazon in the AWS command line interface, so it’s got to be quite stable. It has a thorough specification, and libraries for multiple languages. JMESPath works really quite easy and well. Update: XQuery 3.1 can query either XML or JSON - or both together. The documentation is still in progress, but you can still try it online. or("k") //automatically remembers field and command namesįullname : rec.firstname + " " + rec.lastname, join(records.locations, "location", "locationId", "id") If lets you write queries similar to how you would in LINQ. I'm looking for feedback so I'd be interested in hearing what you think. I'd recommend my project I'm working on called jLinq. 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. It is not only formally specified, but also supported by many JSON libraries. They are also similar to XPath and XQuery conceptually even though XML and JSON have different conceptual models (hierarchic vs object/struct).ĮDIT Sep-2015: Actually there is now JSON Pointer standard that allows very simple and efficient traversal of JSON content. They all seem to be a bit work in progress, but work to some degree.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |