title: Replace value in json from another json
body: <p>I have a json file with the following format:</p>
  
  <pre><code>{userid: 1, client_visited: [1001, 1002]}
  {userid: 2, client_visited: [1001, 1004]}
  {userid: 3, client_visited: [1004, 1006]}
  {userid: 4, client_visited: [1003, 1005, 1006]}
  {userid: 5, client_visited: [1006]}
  </code></pre>
  
  <p>I have a mapping of clients that is output from MYSQL db:</p>
  
  <pre><code>{"1001": a, "1002": b, "1003": c, "1004": d, "1005": e, "1006": f}
  </code></pre>
  
  <p>How can I update the above json file for the following output?</p>
  
  <pre><code>{userid: 1, client_visited: ['a', 'b']}
  {userid: 2, client_visited: ['a', 'd']}
  {userid: 3, client_visited: ['d', 'f']}
  {userid: 4, client_visited: ['c', 'e', 'f']}
  {userid: 5, client_visited: ['f']}
  </code></pre>
  
  <p>I am looking at <code>jq</code> command to achieve this in a shell script.</p>