title: Differences between find_one_and_update() and update_one() in PyMongo for MongoDB?
body: <p>Here are the references for:</p>
  
  <ul>
  <li><a href="http://api.mongodb.com/python/current/api/pymongo/collection.html#pymongo.collection.Collection.find_one_and_update" rel="noreferrer"><code>find_one_and_update</code></a> method</li>
  </ul>
  
  <blockquote>
    <p>Finds a single document and updates it, returning either the original or the updated document.</p>
  </blockquote>
  
  <ul>
  <li><a href="http://api.mongodb.com/python/current/api/pymongo/collection.html#pymongo.collection.Collection.update_one" rel="noreferrer"><code>update_one</code></a> method</li>
  </ul>
  
  <blockquote>
    <p>Update a single document matching the filter.</p>
  </blockquote>
  
  <p>It seems to me both of them first query the selected document, then update it.</p>
  
  <p>I would like to know if there is some kind of optimization difference. The only other difference is in the return value, which makes me wonder why one would even use <code>update_one()</code> at all.</p>