title: Why does MongoDB no longer allow using $set and $unset with an empty document?
body: <p>I just updated from MongoDB version 2.2 to version 2.6 and discovered that you can no longer use <code>$set</code> and <code>$unset</code> operators in the <code>update</code> method with an empty dictionary.  For example, calling <code>db.mytable.update({field:value}, {$set:{}})</code> used to just leave the document unmodified, but now it raises an error, saying that the value to <code>$set</code> can't be empty.</p>
  
  <p>Can someone justify why this is an improvement over the old behavior?  For me, it just creates an unnecessary need for extra logic, such as <code>if</code> statements to make sure the value isn't empty before attempting to <code>update</code>.</p>