jmespath / jmespath/go-jmespath

Filter of comparison works wrong

Open
#90 5 comments 0 reactions 0 assignees View on GitHub
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.