Select with nested collections
How do I construct a query when filtering on a nested collection attribute?
sample data
{"a": [
{"b": "1","c": "1st","e": [{"r": "1","t": "dd"}, {"r": "3","t": "ee"}]},
{"b": "1","c": "2nd","e": [{"r": "4","t": "gg"}, {"r": "5","t": "kk"}]},
{"b": "1","c": "3rd","e": [{"r": "3","t": "hh"}, {"r": "7","t": "pp"}]}
]}
I'm trying to build a query to return a list of a items where the inner collection matches e{r==3}.
So the expect result
[
{"b": "1","c": "1st","e": [{"r": "1","t": "dd"}, {"r": "3","t": "ee"}]},
{"b": "1","c": "3rd","e": [{"r": "3","t": "hh"}, {"r": "7","t": "pp"}]}
]
I can build queries the return the inner list but can't figure how to get the outer collection attributes.
Using http://
query: $.a.where(
result:
All of the elements in a are returned.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- YAQL Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Raleigh Thompson
- Solved:
- Last query:
- Last reply: