Closed ColorfulAvacado closed 3 months ago
I figured it out, my mistake was that the query returns a list (in this case with one element), and the object I was trying to query was inside that previous list. One can use the provided "at" function to strip that out first and then access the objects as intended. So, while the code below did not work:
\```template
{{#each @i in {test_data select list2}}}
- {{@i}}
{{/each}}
\```
This does work as expected:
\```template
{{#each @i in at({test_data}, 0).list2}}
{{@i}}
{{/each}}
\```
According to Objects manual page I can use code blocks to embed yaml data
I am playing around with this I was wondering if it is possible to work with nested yaml data as well.
Let's say I have this yaml block: (the backslashes are just to show how I am using the code block)
I can query it just fine using, for instance:
The above query results one object named "list2" whose value is "1, 2, 3, 4"
However I am not able to query the sub-items of the list (nor of the object):
Expected result:
Current result:
I also tried the following syntax to access nested values, neither of which worked:
Is there any means by which I can achieve this kind of behavior?