title: What's the most pythonic way to copy JSON fields to another JSON structure?
body: <p>Here's the context:  </p>
  
  <ul>
  <li><p>I have a database that cannot accept partial updates of its JSON structures.
  To modify a record you must read the whole JSON record, make modifications and then write back the JSON record, overwriting the previous JSON record.  </p></li>
  <li><p>We receive updates from end users to these JSON records.
  We do not blindly trust that the user is providing a valid and complete new JSON record, so we check that their update contains only field-names that we permit.</p></li>
  </ul>
  
  <p>So, the objective is to say something like:  </p>
  
  <pre><code>1: receive inbound JSON from user along with record id
  2: grab the existing JSON from the database for that record id
  3: for each fieldname in (a list of permitted fieldnames)
    4: if the fieldname is present in the inbound JSON
        5: add that field or update its contents to the existing JSON record
  6: write the resulting JSON structure back to the database
  </code></pre>
  
  <p>My question is, what is the most Pythonic way to implement steps 3, 4 and 5?</p>
  
  <p>I know Python is extremely good at such things and I have seen some very elegant code that does similar things.</p>
  
  <p>Can anyone suggest a general approach that is very elegant and Pythonic?</p>
  
  <p>Please note I'm only interested in Python 3.</p>
  
  <p>thanks</p>