ibatullin / jsonpath_goessner

Automatically exported from code.google.com/p/jsonpath
0 stars 0 forks source link

Filter example on main JSONPATH page is incorrect #21

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
See http://goessner.net/articles/JsonPath/

An example object and expression filters out any book that has a price greater 
than 10:

  $.store.book[?(@.price < 10)].title

This expression returns 4 titles, when it should return only 2 titles.

The correct expression is:

  $.store.book[?(@['price'] < 10)].title

...Running against jsonpath for PHP.

Original issue reported on code.google.com by m...@thebishops.org on 13 Dec 2011 at 9:48