Seems this is not currently supported, calling the method below returns an error:
NoMethodError: undefined method `price' for "reference":String
JsonPath.on("{ "store": {"book": [{ "category": "reference", "price": 8.95} ] }}", "$..book[?(@.price==8.95)].category")