Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter of comparison works wrong #90

Open
liufanghua2012 opened this issue Sep 30, 2023 · 0 comments
Open

Filter of comparison works wrong #90

liufanghua2012 opened this issue Sep 30, 2023 · 0 comments

Comments

@liufanghua2012
Copy link

liufanghua2012 commented Sep 30, 2023

The following codes run with no item returned:
jsondata := []byte({ "table1": [ { "age": 30, "name": "John" } ] })
var data interface{}
json.Unmarshal(jsondata, &data)
result, err := jmespath.Search("table1[?age > '25']", data)

After reading the go-jmespath codes, i found that in the file "github.com\jmespath\go-jmespath@v0.4.0\interpreter.go", line 52, need to consider a string to float convertion, otherwise, we cannot get the right search result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant