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

It doesn't look like jmespath can provide context for a query result #214

Open
kintarowins opened this issue Dec 16, 2020 · 3 comments
Open

Comments

@kintarowins
Copy link

for example I would like to query people[?first=='James'].last with this json

{
  "people": [
    {"first": "James", "last": "d"},
    {"first": "Jacob", "last": "e"},
    {"first": "Jayden", "last": "f"},
    {"missing": "different"}
  ],
}

and instead of just getting the result d, I'd like to also get the full path to it .e.g people[0].last

@springcomp
Copy link

The upcoming let() function in JMESPath Community is specifically designed to achieve this scenario.

@kintarowins
Copy link
Author

Thanks @springcomp. That's cool although I still can't grasp the example given in the preview documentation. My use-case is straight-forward, given a search expression, return the full path to the result.

@springcomp
Copy link

Oh maybe I misconstrued your example.
Unfortunately no, that's not something that would be easily done in the general case I'm afraid. Seems similar to this request if I'm not mistaken?

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

2 participants