title: MongoDB update and increment operation, when update data is an empty hash
body: <p>When using Ruby-on-Rails with ruby version 2.2.0, MongoDB version 3.0.5,</p>
  
  <p>I am experiencing a weird behaviour when trying to execute an update query contains both update and increment, when the update data is an empty hash:</p>
  
  <p>When running the command:</p>
  
  <p>(1) <code>db.collection.update({'user_id' =&gt; 123456}, {'$set' =&gt; {}, '$inc' =&gt; { 'counter' =&gt; 1 }}, {:upsert =&gt; true})</code></p>
  
  <p>The value of the field <code>counter</code> left as it was (no change).</p>
  
  <p>When running the command:</p>
  
  <p>(2) <code>db.collection.update({'user_id' =&gt; 123456}, {'$inc' =&gt; { 'counter' =&gt; 1 }}, {:upsert =&gt; true})</code></p>
  
  <p>The value of the field <code>counter</code> is incremented by 1, as expected.</p>
  
  <p>Can someone please  explain to me why command (1) has a different result than command (2)?</p>