title: Mongodb - duplicate fields in $set and $setOnInsert
body: <p>In <a href="https://stackoverflow.com/questions/23992723/findandmodify-fails-with-error-cannot-update-field1-and-field1-at-the-same/23994425#23994425">this</a> post, the accepted answer explains that you cannot have the same fields under <code>$set</code> and <code>$setOnInsert</code> in an upsert operation.</p>
  
  <p>Can someone explain why this is?  It seems like the <code>$setOnInsert</code> shouldn't conflict with <code>$set</code>, since the former is used when a document is inserted, and the latter is used when the document is updated.</p>