Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Issue filtering with @ #49

Description

@lookitsjonno

Apologies in advance, I'm new to JSONPath.

I do not understand why I am not able to filter based on keys, but a wildcard works. For example:

$content = [
    'body' => [
        'order' => [
            'id' => 2
        ]
    ]
];
// doesn't find the element
var_dump((new JSONPath($content))->find('$.body.order[?(@.id == "2")]'));
// finds the element
var_dump((new JSONPath($content))->find('$..[?(@.id == "2")]'));

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions