jmespath / jmespath/jp

Doubt : Is it possible to return all possible path in a dictionary, having a given value through jp filters ?

Open
#25 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
786
Forks
48
PR merge metrics
No merged PRs in 30d

Description

**Problem Statement**

I have a requirement where I have to search through a raw unstructure non-standard json file and provide all the possible paths which contains a given value.

**Example**
For a given json
```
{
"a" : {"a1": ["1","2", {"a2":"IAMHERE"}] },
"b" : "IAMHERE",
"c" : {"c1" : {"c2" : {"c3" : {"c4" : "1" , "c5" : "IAMHERE"}}}}
}

```
For above json and for a given value "IAMHERE" , I would want to get `[ "a.a1[2].a2" , "b", "c.c1.c2.c3.c5"]` or something similar as those are the paths which has that value.

Also, the structure of the json is not known before hand.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.