title: MongoDB-PHP update overwrites the existing content - why?
body: <p>I ve the following content in mongo db collection,</p>
  
  <pre><code>{ "_id" : ObjectId("5052f343381ef8bc10000011"), "first_name" : "Tadataka", "midle_name"  :      
  "", "last_name" : "Yamada", "title" : "Independent Director", "biogra
  phy" : "Dr. Tadataka Yamada, M.D., is Independent Director of Agilent Technologi
  es Inc., ", "rank" : " ", "department" : " ", "current" : "true", "company_id" :     ObjectId("50072714b4a6deba100051d3"
  ) } }
  </code></pre>
  
  <p>When I tried to update the above content for few fields and also insert new field if not exist, the existing fields get over written. Here is my code,</p>
  
  <pre><code>$mycollection-&gt;update(array("_id" =&gt; $id), array('$set' =&gt; array("first_name" =&gt; $first_name, "updated_at" =&gt; $uat));
  </code></pre>
  
  <p>and the result I am getting is</p>
  
  <pre><code>{ "_id" : ObjectId("5052f343381ef8bc10000011"), "first_name" : "Tadataka", "updated_at" : 134567894 }
  </code></pre>
  
  <p>Instead of updating just the values, my whole content gets overwritten, where I am missing.?</p>