JSONPath-Plus / JSONPath

A fork of JSONPath from http://goessner.net/articles/JsonPath/
Other
963 stars 169 forks source link

sorting support? #125

Open theoephraim opened 4 years ago

theoephraim commented 4 years ago

Been looking all over for a jsonpath type tool that supports sorting - ie sort the items in an array by a property within a query/path. A similar example is described here using an extension in a python jsonpath implementation.

In their implementation, slashes are used to signify sort and which direction, but I can imagine other alternatives and it is by no means a standard as I have yet to see it anywhere you else. You can imagine a path of items[\price][3].name to "get the names of top 3 items sorted by price (descendin)"

Does this seem feasible to add to this tool? I imagine many folks would want to use this kind of query, and could be worth supporting.

brettz9 commented 4 years ago

This library is not currently being very actively developed, especially for new features. However, we should be able to review any PRs.