title: Apply limit in mapreduce function in php?
body: <p>How to apply limit in <code>php, mongodb</code> when using <code>mapreduce</code> function?
  I tried this </p>
  
  <pre><code>$cmd=array(// codition array
  "mapreduce" =&gt; "user", 
  "map" =&gt; $map,
  "reduce" =&gt; $reduce,
  "out" =&gt; array("inline" =&gt; 1),
  "limit"=&gt;2
  );
  
  $db=connect();
  $query = $db-&gt;command($cmd);// run command
  </code></pre>
  
  <p>But its not working it gives 2 documents.I can't use limit on sub documents.
  If I have 100's of sub documents and then I want paging in sub documents.Then it fails.Is it possible to apply limit on sub documents?</p>