title: Mongo db add new field to a collection and update if field already exists
body: <p>I have mongo collection array as below</p>
  
  <pre><code>[_id] =&gt; MongoId Object (
      [$id] =&gt; 7f841cef13cfcdba230019e2
  )
  [id] =&gt; 33
  [name] =&gt; Adam
  [table] =&gt; people
  </code></pre>
  
  <p>I want to add a field count to existing one </p>
  
  <pre><code>[_id] =&gt; MongoId Object (
      [$id] =&gt; 7f841cef13cfcdba230019e2
  )
  [id] =&gt; 33
  [name] =&gt; Adam
  [count] =&gt; 0
  [table] =&gt; people
  </code></pre>
  
  <p>If count is already set , then update the array. </p>
  
  <p>I have used 'update' method, but need to change the all array instead of one field. How I can do this with php ?</p>