join two json files based on common key with jq utility or alternative way from command line
<p>I have 2 json files with common key and I need to JOIN them with <strong><em>jq</em></strong> utility or alternative way from command line As follows:</p>

<p>(for example: jq -join -key "id" jsonFile1 jsonFile2)</p>

<p>jsonFile1:</p>

<pre><code>{"id":"10","data":"abc"}
{"id":"20","data":"xyz"}
{"id":"30","data":"qwe"}
{"id":"40","data":"wsx"}
{"id":"50","data":"zxc"}
</code></pre>

<p>jsonFile2:</p>

<pre><code>{"id":"60","content":"ert"}
{"id":"40","content":"tgb"}
{"id":"10","content":"yui"}
{"id":"30","content":"ujm"}
{"id":"70","content":"rfv"}
</code></pre>

<p>output:</p>

<pre><code>{"id":"10","data":"abc","content":"yui"}
{"id":"30","data":"qwe","content":"ujm"}
{"id":"40","data":"wsx","content":"tgb"}
</code></pre>