go-jmespath icon indicating copy to clipboard operation
go-jmespath copied to clipboard

Filter of comparison works wrong

Open liufanghua2012 opened this issue 2 years ago • 5 comments

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\[email protected]\interpreter.go", line 52, need to consider a string to float convertion, otherwise, we cannot get the right search result.

liufanghua2012 avatar Sep 30 '23 09:09 liufanghua2012

I am running into the same issue trying to compare against dates. It works fine in the online playground but not with the Go package.

dpopp07 avatar Jun 27 '24 15:06 dpopp07