Skip to content

root array with filter expression does not work #20

@asaf

Description

@asaf

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions