title: Cursor Timed out error on MongoDb cursor
body: <p>I have just started using mongoDb as my backend for PHP.</p>
  
  <p>I am simply using find() query for one of my needs. I want only first 100 results but also want to get total available results. I am trying this.</p>
  
  <pre><code>    $cursor = $this-&gt;dbReference-&gt;dbName-&gt;find($query);
      if($count != 0)
      {
              $cursor-&gt;skip($startIndex);
              $cursor-&gt;limit($count);
      }
      $totalCount = $cursor-&gt;count();
  
      $entries = array();
      while ($cursor-&gt;hasNext())
      {
              $cursor-&gt;next();
              $entry = $cursor-&gt;current();
              array_push($entries , $entry);
      }
  </code></pre>
  
  <p>Now The problem is.. T
  his search result contains exactly more than 50K results. But I am retrieving only 100 at a time.
  I am using $cursor->count() for getting total number of available result rows.
  on this line error is showing that "Cursor timed out". Please can anyone suggest me whats the problem? or what is the alternative to find total count of search result.</p>
  
  <p>Thanks in advance.</p>