go-jmespath
go-jmespath copied to clipboard
Filter of comparison works wrong
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.
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.