Skip to content
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

root array with filter expression does not work #20

Open
asaf opened this issue Aug 8, 2018 · 0 comments
Open

root array with filter expression does not work #20

asaf opened this issue Aug 8, 2018 · 0 comments

Comments

@asaf
Copy link

asaf commented Aug 8, 2018

hey,

seems like root array with filter exp doesn't work

here's an example:

arr := []map[string]interface{}{
		{
			"id": 1,
			"foo": map[string]interface{}{
				"bar": "baz",
			},
		},
	}

obj := map[string][]map[string]interface{}{
	"obj": arr,
}

// yields result
jsonpath.JsonPathLookup(obj, "$.obj[?(@.id == 1)]")

// yields no result
jsonpath.JsonPathLookup(arr, path, "$.[?(@.id == 1)]")

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant