class Builder extends Builder (View source)

Fluent interface for building aggregation pipelines.

Methods

__construct(DocumentManager $dm, string $documentName)

Create a new aggregation builder.

execute($options = [])

{@inheritdoc}

hydrate(string $className)

Set which class to use when hydrating results as document class instances.

matchExpr()

No description

expr()

No description

bucket()

No description

bucketAuto()

No description

graphLookup(string $from)

No description

match()

No description

lookup(string $from)

No description

Out
out(string $from)

No description

replaceRoot(string|null $expression = null)

No description

sortByCount($expression)

No description

sort($fieldName, $order = null)

{@inheritdoc}

unwind($fieldName)

{@inheritdoc}

array
getPipeline()

Returns the assembled aggregation pipeline

Details

__construct(DocumentManager $dm, string $documentName)

Create a new aggregation builder.

Parameters

DocumentManager $dm
string $documentName

execute($options = [])

{@inheritdoc}

Parameters

$options

Builder hydrate(string $className)

Set which class to use when hydrating results as document class instances.

Parameters

string $className

Return Value

Builder

Expr matchExpr()

Return Value

Expr

Expr expr()

Return Value

Expr

Bucket bucket()

Return Value

Bucket

BucketAuto bucketAuto()

Return Value

BucketAuto

GraphLookup graphLookup(string $from)

Parameters

string $from

Return Value

GraphLookup

Match match()

Return Value

Match

Lookup lookup(string $from)

Parameters

string $from

Return Value

Lookup

Out out(string $from)

Parameters

string $from

Return Value

Out

ReplaceRoot replaceRoot(string|null $expression = null)

Parameters

string|null $expression Optional. A replacement expression that resolves to a document.

Return Value

ReplaceRoot

SortByCount sortByCount($expression)

Parameters

$expression

Return Value

SortByCount

sort($fieldName, $order = null)

{@inheritdoc}

Parameters

$fieldName
$order

unwind($fieldName)

{@inheritdoc}

Parameters

$fieldName

array getPipeline()

Returns the assembled aggregation pipeline

For pipelines where the first stage is a $geoNear stage, it will apply the document filters and discriminator queries to the query portion of the geoNear operation. For all other pipelines, it prepends a $match stage containing the required query.

Return Value

array