this is about the general behavior of loop (for list under a list)
my doc structure
doc/docfirstlist/docsecondlist
i wanted to just loop on right most list loop (input array as doc/docfirstlist[0]/docsecondlist), unfortunately inside loop i can’t loop on the docsecondlist item.
what resolved is having two loops one loop for doc/docfirstlist and under this loop another loop for doc/docfirstlist/docsecondlist
please confirm whats the correct way of looping only on doc/docfirstlist[0]/docsecondlist
can you map the first item of first list to a new doc?
Then use this doc as input for the loop.
Additional info:
The structure used as input for a loop shows up as a list outside of the loop, but inside the loop it looks like a flat doc with the same inner structure representing the current item for the iteration identified by $iteration-variable.
you have to use two different loops (first loop over parent list and inside that loop again on child list)
use inbuilt service: pub.document:searchDocuments - in this case you no need to use multiple loops, pass the required keys in the search criteria ti get the child list data…go through the documentation for more details.