PHP Класс Sokil\Mongo\Pipeline

Наследование: implements Sokil\Mongo\ArrayableInterface, implements JsonSerializable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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.

Приватные методы

Метод Описание
addStage ( string $operator, mixed $stage )

Описание методов

__construct() публичный Метод

public __construct ( Collection $collection )
$collection Collection

__toString() публичный Метод

public __toString ( )

aggregate() публичный Метод

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

aggregateCursor() публичный Метод

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

allowDiskUse() публичный Метод

public allowDiskUse ( $allow = true )

explain() публичный Метод

public explain ( $allow = true )

getOptions() публичный Метод

public getOptions ( )

group() публичный Метод

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
Результат Pipeline

jsonSerialize() публичный Метод

public jsonSerialize ( )

limit() публичный Метод

public limit ( $limit )

match() публичный Метод

Filter documents by expression
public match ( array | Expression $expression ) : Pipeline
$expression array | Expression
Результат Pipeline

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.
public project ( array $pipeline ) : Pipeline
$pipeline array
Результат Pipeline

setBatchSize() публичный Метод

public setBatchSize ( $batchSize )

skip() публичный Метод

public skip ( $skip )

sort() публичный Метод

public sort ( array $sortFields )
$sortFields array

toArray() публичный Метод

public toArray ( )

unwind() публичный Метод

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
Результат Pipeline