Doctrine\MongoDB\Aggregation\Builder::limit PHP Method

limit() public method

Limits the number of documents passed to the next stage in the pipeline.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/limit/
public limit ( integer $limit ) : Doctrine\MongoDB\Aggregation\Stage\Limit
$limit integer
return Doctrine\MongoDB\Aggregation\Stage\Limit
    public function limit($limit)
    {
        return $this->addStage(new Stage\Limit($this, $limit));
    }

Usage Example

Example #1
0
 /**
  * Limits the number of documents passed to the next stage in the pipeline.
  *
  * @see http://docs.mongodb.org/manual/reference/operator/aggregation/limit/
  *
  * @param integer $limit
  * @return Stage\Limit
  */
 public function limit($limit)
 {
     return $this->builder->limit($limit);
 }