PHP 클래스 Doctrine\MongoDB\Aggregation\Builder

부터: 1.2
저자: alcaeus ([email protected])
파일 보기 프로젝트 열기: doctrine/mongodb 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Doctrine\MongoDB\Collection $collection ) Create a new aggregation builder.
execute ( array $options = [] ) : Doctrine\MongoDB\Iterator Executes the aggregation pipeline
expr ( ) : Expr
geoNear ( float | array | GeoJson\Geometry\Point $x, float $y = null ) : Doctrine\MongoDB\Aggregation\Stage\GeoNear Outputs documents in order of nearest to farthest from a specified point.
getPipeline ( ) : array Returns the assembled aggregation pipeline
getStage ( integer $index ) : Stage Returns a certain stage from the pipeline
group ( ) : Group Groups documents by some specified expression and outputs to the next stage a document for each distinct grouping.
indexStats ( ) : Doctrine\MongoDB\Aggregation\Stage\IndexStats Returns statistics regarding the use of each index for the collection.
limit ( integer $limit ) : Doctrine\MongoDB\Aggregation\Stage\Limit Limits the number of documents passed to the next stage in the pipeline.
lookup ( string $from ) : Doctrine\MongoDB\Aggregation\Stage\Lookup Performs a left outer join to an unsharded collection in the same database to filter in documents from the “joined” collection for processing.
match ( ) : Match Filters the documents to pass only the documents that match the specified condition(s) to the next pipeline stage.
matchExpr ( ) : Expr Returns a query expression to be used in match stages
out ( string $collection ) : Out Takes the documents returned by the aggregation pipeline and writes them to a specified collection. This must be the last stage in the pipeline.
project ( ) : Project Passes along the documents with only the specified fields to the next stage in the pipeline. The specified fields can be existing fields from the input documents or newly computed fields.
redact ( ) : Doctrine\MongoDB\Aggregation\Stage\Redact Restricts the contents of the documents based on information stored in the documents themselves.
sample ( integer $size ) : Doctrine\MongoDB\Aggregation\Stage\Sample Randomly selects the specified number of documents from its input.
skip ( integer $skip ) : Doctrine\MongoDB\Aggregation\Stage\Skip Skips over the specified number of documents that pass into the stage and passes the remaining documents to the next stage in the pipeline.
sort ( array | string $fieldName, integer | string $order = null ) : Doctrine\MongoDB\Aggregation\Stage\Sort Sorts all input documents and returns them to the pipeline in sorted order.
unwind ( string $fieldName ) : Doctrine\MongoDB\Aggregation\Stage\Unwind Deconstructs an array field from the input documents to output a document for each element. Each output document is the input document with the value of the array field replaced by the element.

보호된 메소드들

메소드 설명
addStage ( Stage $stage ) : Stage

메소드 상세

__construct() 공개 메소드

Create a new aggregation builder.
public __construct ( Doctrine\MongoDB\Collection $collection )
$collection Doctrine\MongoDB\Collection

addStage() 보호된 메소드

protected addStage ( Stage $stage ) : Stage
$stage Stage
리턴 Stage

execute() 공개 메소드

Executes the aggregation pipeline
public execute ( array $options = [] ) : Doctrine\MongoDB\Iterator
$options array
리턴 Doctrine\MongoDB\Iterator

expr() 공개 메소드

public expr ( ) : Expr
리턴 Expr

geoNear() 공개 메소드

A GeoJSON point may be provided as the first and only argument for 2dsphere queries. This single parameter may be a GeoJSON point object or an array corresponding to the point's JSON representation. If GeoJSON is used, the "spherical" option will default to true. You can only use this as the first stage of a pipeline.
또한 보기: http://docs.mongodb.org/manual/reference/operator/aggregation/geoNear/
public geoNear ( float | array | GeoJson\Geometry\Point $x, float $y = null ) : Doctrine\MongoDB\Aggregation\Stage\GeoNear
$x float | array | GeoJson\Geometry\Point
$y float
리턴 Doctrine\MongoDB\Aggregation\Stage\GeoNear

getPipeline() 공개 메소드

Returns the assembled aggregation pipeline
public getPipeline ( ) : array
리턴 array

getStage() 공개 메소드

Returns a certain stage from the pipeline
public getStage ( integer $index ) : Stage
$index integer
리턴 Stage

group() 공개 메소드

Groups documents by some specified expression and outputs to the next stage a document for each distinct grouping.
또한 보기: http://docs.mongodb.org/manual/reference/operator/aggregation/group/
public group ( ) : Group
리턴 Doctrine\MongoDB\Aggregation\Stage\Group

indexStats() 공개 메소드

Returns statistics regarding the use of each index for the collection.
또한 보기: https://docs.mongodb.org/manual/reference/operator/aggregation/indexStats/
public indexStats ( ) : Doctrine\MongoDB\Aggregation\Stage\IndexStats
리턴 Doctrine\MongoDB\Aggregation\Stage\IndexStats

limit() 공개 메소드

Limits the number of documents passed to the next stage in the pipeline.
또한 보기: http://docs.mongodb.org/manual/reference/operator/aggregation/limit/
public limit ( integer $limit ) : Doctrine\MongoDB\Aggregation\Stage\Limit
$limit integer
리턴 Doctrine\MongoDB\Aggregation\Stage\Limit

lookup() 공개 메소드

Performs a left outer join to an unsharded collection in the same database to filter in documents from the “joined” collection for processing.
또한 보기: https://docs.mongodb.org/manual/reference/operator/aggregation/lookup/
public lookup ( string $from ) : Doctrine\MongoDB\Aggregation\Stage\Lookup
$from string
리턴 Doctrine\MongoDB\Aggregation\Stage\Lookup

match() 공개 메소드

Filters the documents to pass only the documents that match the specified condition(s) to the next pipeline stage.
또한 보기: http://docs.mongodb.org/manual/reference/operator/aggregation/match/
public match ( ) : Match
리턴 Doctrine\MongoDB\Aggregation\Stage\Match

matchExpr() 공개 메소드

Returns a query expression to be used in match stages
public matchExpr ( ) : Expr
리턴 Doctrine\MongoDB\Query\Expr

out() 공개 메소드

Takes the documents returned by the aggregation pipeline and writes them to a specified collection. This must be the last stage in the pipeline.
또한 보기: http://docs.mongodb.org/manual/reference/operator/aggregation/out/
public out ( string $collection ) : Out
$collection string
리턴 Doctrine\MongoDB\Aggregation\Stage\Out

project() 공개 메소드

Passes along the documents with only the specified fields to the next stage in the pipeline. The specified fields can be existing fields from the input documents or newly computed fields.
또한 보기: http://docs.mongodb.org/manual/reference/operator/aggregation/project/
public project ( ) : Project
리턴 Doctrine\MongoDB\Aggregation\Stage\Project

redact() 공개 메소드

Restricts the contents of the documents based on information stored in the documents themselves.
또한 보기: http://docs.mongodb.org/manual/reference/operator/aggregation/redact/
public redact ( ) : Doctrine\MongoDB\Aggregation\Stage\Redact
리턴 Doctrine\MongoDB\Aggregation\Stage\Redact

sample() 공개 메소드

Randomly selects the specified number of documents from its input.
또한 보기: https://docs.mongodb.org/manual/reference/operator/aggregation/sample/
public sample ( integer $size ) : Doctrine\MongoDB\Aggregation\Stage\Sample
$size integer
리턴 Doctrine\MongoDB\Aggregation\Stage\Sample

skip() 공개 메소드

Skips over the specified number of documents that pass into the stage and passes the remaining documents to the next stage in the pipeline.
또한 보기: http://docs.mongodb.org/manual/reference/operator/aggregation/skip/
public skip ( integer $skip ) : Doctrine\MongoDB\Aggregation\Stage\Skip
$skip integer
리턴 Doctrine\MongoDB\Aggregation\Stage\Skip

sort() 공개 메소드

If sorting by multiple fields, the first argument should be an array of field name (key) and order (value) pairs.
또한 보기: http://docs.mongodb.org/manual/reference/operator/aggregation/sort/
public sort ( array | string $fieldName, integer | string $order = null ) : Doctrine\MongoDB\Aggregation\Stage\Sort
$fieldName array | string Field name or array of field/order pairs
$order integer | string Field order (if one field is specified)
리턴 Doctrine\MongoDB\Aggregation\Stage\Sort

unwind() 공개 메소드

Deconstructs an array field from the input documents to output a document for each element. Each output document is the input document with the value of the array field replaced by the element.
또한 보기: http://docs.mongodb.org/manual/reference/operator/aggregation/unwind/
public unwind ( string $fieldName ) : Doctrine\MongoDB\Aggregation\Stage\Unwind
$fieldName string The field to unwind. It is automatically prefixed with the $ sign
리턴 Doctrine\MongoDB\Aggregation\Stage\Unwind