Mongodb insert into existing array
<p>Hey im having issues inserting an element into an existing mongodb document.
At the moment there is an array containing a single element in my db :</p>

<pre><code>$count = array();
array_push($count, 0);
$dbase-&gt;insert(array("_id"=&gt; $_id,"count"=&gt;$count));
</code></pre>

<p>However i now wish to insert a single element back into the "count array" and after looking around this was the recommended way:</p>

<pre><code> $count=4;
 $dbase-&gt;update(array('_id'=&gt;'57b35f7bce23505c10000029'),array('$count'=&gt;$count));
</code></pre>

<p>However this is throwing an error (error 500, internal server error) and im unsure why. Iv also tried using insert but it results in the creation of a new document. Any help would be appreciated.</p>