title: Python - Pymongo Insert and Update Documents
body: <p>Using PyMongo, I have a set of dict's in a list that I'd like to submit to my MongoDB. Some of the items in the list are new entries, and some are to update.</p>
  
  <p>Example:</p>
  
  <p><strong>On Server Database:</strong></p>
  
  <pre><code>[{"_id" : 1, "foo" : "bar}]
  </code></pre>
  
  <p><strong>To send to database:</strong></p>
  
  <pre><code>[{"_id" : 1, "foo" : "HELLO"}, {"_id" : 2, "Blah" : "Bloh"}]
  </code></pre>
  
  <p>I'm currently using the following to insert documents, but how would I do something like stated above? Any help is appreciated!</p>
  
  <pre><code>collection.insert(myDict)
  </code></pre>