title: Doctrine MongoDB ODM: must one call flush() after findAndUpdate()?
body: <p>Empirically it seems that <code>flush()</code> is not necessary after <code>findAndUpdate()</code>, I just couldn't find this explicitly stated anywhere in the Doctrine ODM/MongoDB docs (and I didn't bother to read much source code).</p>
  
  <p>The <a href="http://www.mongodb.org/display/DOCS/findAndModify+Command" rel="nofollow"><code>findAndModify</code> docs on mongodb.org</a> state</p>
  
  <blockquote>
    <p>This command can be used to atomically modify a document (at most one) and return it.</p>
  </blockquote>
  
  <p>And <a href="http://docs.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/reference/find-and-update.html" rel="nofollow">Doctrine MongoDB's <code>findAndUpdate()</code> uses MongoDB's <code>findAndModify</code></a>. So it sounds like the whole thing does indeed happen in one go, so calling <code>flush()</code> on the document manager shouldn't be necessary.</p>