5 ms·
Wait a second, you left out the most important part: What's in the `log(...)` function? How do you get the name of the pet and the name of the staff in that lin
by vortico 6y ago
Wait a second, you left out the most important part: What's in the `log(...)` function? How do you get the name of the pet and the name of the staff in that line if they have the same accessor `.name`?
That's my point. The fact that you didn't include it implies to me that it was too difficult to figure out, and a true implementation would be far more complicated, so it's not a fair comparison.
- mgraczyk 6y agoI disagree, there are many ways to solve this problem. for example .company.staff | .pets | flatten | filter .type == "cat" | print(.name + " belongs to " + ..name)