Skip to content

Current object placeholder only works when its on the right side of an logical expression #180

Description

@pranav-surya

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions