title: count mongodb in php
body: <p>I have a collection user which has 2 parameters (Username,paid), username is a string and paid is a string too, i should count how many users with the parameter paid="true"</p>
  
  <p>this is my try</p>
  
  <pre><code>&lt;?php
  
  $connection = new MongoClient();
  $collection = $connection-&gt;Ahmed-&gt;user;
  
  $cursor = $collection-&gt;find();
  var_dump($collection-&gt;count());
  var_dump($collection-&gt;count($cursor-&gt;paid=&gt;"true")));
  ?&gt;
  </code></pre>
  
  <p>if there is an expert in mongo could help, thanks :)</p>