title: Quickly add field to large MongoDB collection by _id
body: <p>I have a MongoDB collection like:</p>
  <pre><code>[{'_id': abc, 'Sex': 'f'}, {'_id': bcd, 'Sex': 'm'}, {'_id': cde, 'Sex': 'm'}, {'_id': def, 'Sex': 'm'}]
  </code></pre>
  <p>I also have a Python list of dictionaries like:</p>
  <pre><code>[{'_id': abc, 'Age': 70}, {'_id': bcd, 'Age': 51}, {'_id': cde}, {'_id': def, 'Age': 'unknown'}]
  </code></pre>
  <p>I need to match by <code>_id</code> on a large collection, updating each document, e.g., as below:</p>
  <pre><code>[{'_id': abc, 'Sex': 'f', 'Age': 70}, {'_id': bcd, 'Sex': 'm', 'Age': 51}, {'_id': cde, 'Sex': 'm'}, {'_id': def, 'Sex': 'm', 'Age': 'unknown'}]
  </code></pre>
  <p>Is there a way to do this <strong>efficiently</strong> for a large collection? (Not just iterating through the list of dictionaries and using <code>update_one</code> on each document.)</p>