title: Updating MongoDB Date in String to Date Format
body: <p>I am re-asking this question as there seemed to be some misunderstanding.  I need to convert a string in my mongo to a date format using Python.  I have the following code:</p>
  
  <pre><code>newest_date = datetime.strptime(r["date"], "%Y-%m-%d").isoformat()
  </code></pre>
  
  <p>Which successfully created the following date object (new_date):</p>
  
  <pre><code>2017-01-03T00:00:00
  </code></pre>
  
  <p>When I try:</p>
  
  <pre><code>db.address.update_one({"address": "1234", {"$set": {"date" : new_date}})
  </code></pre>
  
  <p>I get the item updated in the document but it's still a string, not a date.  I can successfully do it in the shell using:</p>
  
  <pre><code>db.address.find({ "date" : { $type : 2 } } ).forEach(function(element){  element.date = ISODate(element.date); db.address.save(element);})
  </code></pre>
  
  <p>How can I update the actual type to be a date because when I do it from the console I get the output:</p>
  
  <pre><code>"date": {"$date": "2017-06-28T00:00:00.000Z"
  </code></pre>
  
  <p>},</p>