The following code works as expected
require 'jsonpath'
json = <<-JSON
{
"colors": [
"yellow",
"green"
]
}
JSON
path = JsonPath.new("$.colors[?(@ == 'green')]")
path.on(json)
but when we do this for the same json as in the above example, the filtering is not working as expected
path = JsonPath.new("$.colors[?('green' == @)]")
path.on(json)