title: mongo count(*) with php but without sending all result array
body: <p>I am writing my scripts in PHP and I try to convert SQL</p>
  
  <pre><code>SELECT COUNT(*) AS Rank  
  FROM user    
  WHERE  user.lvl &gt; $user_level
  </code></pre>
  
  <p>query to Mongo.</p>
  
  <p>I found only one decision:</p>
  
  <pre><code>$nosql = array(
       'lvl' =&gt; array('$gt' =&gt; $user_level)
  );    
  $result = $collection-&gt;find($nosql);
  $length = count(iterator_to_array($result));
  </code></pre>
  
  <ol>
  <li>get all objects which satisfy the condition</li>
  <li>And count them in PHP</li>
  </ol>
  
  <p>It is possible to get count of needed objects without sending all array?</p>