-
Notifications
You must be signed in to change notification settings - Fork 91
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
Comments
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. |
I have the same issue as well. |
Related: aws/aws-sdk-go-v2#2983 A simple repro that demonstrates the breakdown here: package main
import (
"fmt"
jmespath "github.com/jmespath/go-jmespath"
)
func main() {
out := map[string]any{
"MinSize": 2,
"MaxSize": 7,
}
pathValue, err := jmespath.Search("MaxSize > MinSize", out)
if err != nil {
panic(err)
}
fmt.Println("go-jmespath gives us", pathValue)
} prints
It appears that ordering comparison (>, >=, <, <=) is unimplemented, broken, or some combination of the two. |
The community fork appears to be broken in the same way. |
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.
The text was updated successfully, but these errors were encountered: