jmespath / jmespath/go-jmespath
Filter of comparison works wrong
Open
- Dominant language
- Go
- Stars
- 621
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.