0
如何在使用mapreduce
函數時在php, mongodb
中應用限制? 我想這在php中使用mapreduce函數限制?
$cmd=array(// codition array
"mapreduce" => "user",
"map" => $map,
"reduce" => $reduce,
"out" => array("inline" => 1),
"limit"=>2
);
$db=connect();
$query = $db->command($cmd);// run command
但它不工作它給2個documents.I不能在子文檔中使用的限制。 如果我有100個子文檔,然後我希望在子文檔中分頁,那麼它會失敗。是否可以對子文檔應用限制?