PHP Class Sokil\Mongo\Pipeline

Inheritance: implements Sokil\Mongo\ArrayableInterface, implements JsonSerializable
Afficher le fichier Open project: sokil/php-mongo Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( Collection $collection )
__toString ( )
aggregate ( array $options = [] )
aggregateCursor ( array $options = [] )
allowDiskUse ( $allow = true )
explain ( $allow = true )
getOptions ( )
group ( array | callable $stage ) : Pipeline Groups documents by some specified expression and outputs to the next stage a document for each distinct grouping. The output documents contain an _id field which contains the distinct group by key. The output documents can also contain computed fields that hold the values of some accumulator expression grouped by the $group‘s _id field. $group does not order its output documents.
jsonSerialize ( )
limit ( $limit )
match ( array | Expression $expression ) : Pipeline Filter documents by expression
project ( array $pipeline ) : Pipeline 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.
setBatchSize ( $batchSize )
skip ( $skip )
sort ( array $sortFields )
toArray ( )
unwind ( string $path ) : Pipeline Deconstructs an array field from the input documents to output a document for each element.

Private Methods

Méthode Description
addStage ( string $operator, mixed $stage )

Method Details

__construct() public méthode

public __construct ( Collection $collection )
$collection Collection

__toString() public méthode

public __toString ( )

aggregate() public méthode

public aggregate ( array $options = [] )
$options array

aggregateCursor() public méthode

public aggregateCursor ( array $options = [] )
$options array

allowDiskUse() public méthode

public allowDiskUse ( $allow = true )

explain() public méthode

public explain ( $allow = true )

getOptions() public méthode

public getOptions ( )

group() public méthode

Groups documents by some specified expression and outputs to the next stage a document for each distinct grouping. The output documents contain an _id field which contains the distinct group by key. The output documents can also contain computed fields that hold the values of some accumulator expression grouped by the $group‘s _id field. $group does not order its output documents.
public group ( array | callable $stage ) : Pipeline
$stage array | callable
Résultat Pipeline

jsonSerialize() public méthode

public jsonSerialize ( )

limit() public méthode

public limit ( $limit )

match() public méthode

Filter documents by expression
public match ( array | Expression $expression ) : Pipeline
$expression array | Expression
Résultat Pipeline

project() public méthode

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.
public project ( array $pipeline ) : Pipeline
$pipeline array
Résultat Pipeline

setBatchSize() public méthode

public setBatchSize ( $batchSize )

skip() public méthode

public skip ( $skip )

sort() public méthode

public sort ( array $sortFields )
$sortFields array

toArray() public méthode

public toArray ( )

unwind() public méthode

Each output document is the input document with the value of the array field replaced by the element.
public unwind ( string $path ) : Pipeline
$path string path to field
Résultat Pipeline