How to merge two lists that have a one to many relationship #1451
I have two files:
File_2 - it has many rows for each business.
The output should look like
I am using this code
jq -nc --slurpfile file1 file1.json --slurpfile file2 file2.json -f join.jq
But it keeps only joining the last item in the review file like this
How do I put a loop in that will iterate all the items in the second file?
I believe the following variant of your program will do what you want:
@brandlij - Thanks. If you intend your question to be a feature request, then please clarify that, otherwise you could CLOSE the issue. For future reference, please ask ordinary usage questions at stackoverflow.com with the jq tag as stackoverflow.com is better suited to the Q&A format.
Also for future reference, if something like