volans-/gjson-py

Use nested queries.

Chutchev opened this issue · 3 comments

I understand correctly that nested queries have not yet been implemented?

For example:

{
  "name": {"first": "Tom", "last": "Anderson"},
  "age":37,
  "children": ["Sara","Alex","Jack"],
  "fav.movie": "Deer Hunter",
  "friends": [
    {"first": "Dale", "last": "Murphy", "age": 44, "nets": ["ig", "fb", "tw"]},
    {"first": "Roger", "last": "Craig", "age": 68, "nets": ["fb", "tw"]},
    {"first": "Jane", "last": "Murphy", "age": 47, "nets": ["ig", "tw"]}
  ]
}

Nested query:

friends.#(nets.#(=="fb"))#.first  >> ["Dale","Roger"]

@Chutchev that's correct, sub-queries (or nested queries) have not yet been implemented.
Can I ask you if the note in the supported features matrix for the Queries line is not clear enough and need some additional details?

At the moment I was looking to add support for Multipaths, but of course feature requests are welcome to help prioritize.

@volans I did not correlate subqueries-nested queries

Thank you!

@Chutchev If you're still interested, for your information starting with the v0.4.0 release now gjson-py does support nested queries. I hope this helps.