title: How to set limit() into MongoQuery Using PHP?
body: <p>I have to use Mongodb with php, and tried to get data from mongocollection using php. the follwing mongoquery with php return record successfully. but i want to set limit for following query.</p>
  
  <p>PHP Code:</p>
  
  <pre><code>$query = array("\$and"=&gt;array(array('fld'=&gt; array("\$in"=&gt; array('4', '14', '20'))), array('stat'=&gt;array("\$eq"=&gt;"A"))));
  
  $cursor = $this-&gt;collection-&gt;find($query);
  </code></pre>
  
  <p>i have also tried follwing way</p>
  
  <pre><code>$query = array("\$and"=&gt;array(array('fld'=&gt; array("\$in"=&gt; array('4', '14', '20'))), array('stat'=&gt;array("\$eq"=&gt;"A")))).limit(2);
  </code></pre>
  
  <p>But I got Fatal Error </p>
  
  <blockquote>
    <p>Call to undefined function limit()</p>
  </blockquote>
  
  <p>How to use <code>limit()</code> in above query?</p>