PHP Class Doctrine\MongoDB\Aggregation\Stage\Group

Since: 1.2
Author: alcaeus ([email protected])
Inheritance: extends Doctrine\MongoDB\Aggregation\Stage
Datei anzeigen Open project: doctrine/mongodb Class Usage Examples

Protected Properties

Property Type Description
$expr Doctrine\MongoDB\Aggregation\Expr

Public Methods

Method Description
__construct ( Builder $builder )
addToSet ( mixed | Expr $expression ) : Operator Returns an array of all unique values that results from applying an expression to each document in a group of documents that share the same group by key. Order of the elements in the output array is unspecified.
avg ( mixed | Expr $expression ) : Operator Returns the average value of the numeric values that result from applying a specified expression to each document in a group of documents that share the same group by key. Ignores nun-numeric values.
expression ( mixed | Expr $value ) Used to use an expression as field value. Can be any expression
field ( string $fieldName ) Set the current field for building the expression.
first ( mixed | Expr $expression ) : Operator Returns the value that results from applying an expression to the first document in a group of documents that share the same group by key. Only meaningful when documents are in a defined order.
getExpression ( )
last ( mixed | Expr $expression ) : Operator Returns the value that results from applying an expression to the last document in a group of documents that share the same group by a field.
max ( mixed | Expr $expression ) : Operator Returns the highest value that results from applying an expression to each document in a group of documents that share the same group by key.
min ( mixed | Expr $expression ) : Operator Returns the lowest value that results from applying an expression to each document in a group of documents that share the same group by key.
push ( mixed | Expr $expression ) : Operator Returns an array of all values that result from applying an expression to each document in a group of documents that share the same group by key.
stdDevPop ( mixed | Expr $expression ) Calculates the population standard deviation of the input values.
stdDevSamp ( mixed | Expr $expression ) Calculates the sample standard deviation of the input values.
sum ( mixed | Expr $expression ) : Operator Calculates and returns the sum of all the numeric values that result from applying a specified expression to each document in a group of documents that share the same group by key. Ignores nun-numeric values.

Method Details

__construct() public method

public __construct ( Builder $builder )
$builder Doctrine\MongoDB\Aggregation\Builder

addToSet() public method

AddToSet is an accumulator operation only available in the group stage.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/addToSet/
See also: Expr::addToSet
public addToSet ( mixed | Expr $expression ) : Operator
$expression mixed | Doctrine\MongoDB\Aggregation\Expr
return Operator

avg() public method

Returns the average value of the numeric values that result from applying a specified expression to each document in a group of documents that share the same group by key. Ignores nun-numeric values.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/avg/
See also: Expr::avg
public avg ( mixed | Expr $expression ) : Operator
$expression mixed | Doctrine\MongoDB\Aggregation\Expr
return Operator

expression() public method

Used to use an expression as field value. Can be any expression
See also: http://docs.mongodb.org/manual/meta/aggregation-quick-reference/#aggregation-expressions
See also: Expr::expression
public expression ( mixed | Expr $value )
$value mixed | Doctrine\MongoDB\Aggregation\Expr

field() public method

Set the current field for building the expression.
See also: Expr::field
public field ( string $fieldName )
$fieldName string

first() public method

Returns the value that results from applying an expression to the first document in a group of documents that share the same group by key. Only meaningful when documents are in a defined order.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/first/
See also: Expr::first
public first ( mixed | Expr $expression ) : Operator
$expression mixed | Doctrine\MongoDB\Aggregation\Expr
return Operator

getExpression() public method

public getExpression ( )

last() public method

Only meaningful when documents are in a defined order.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/last/
See also: Expr::last
public last ( mixed | Expr $expression ) : Operator
$expression mixed | Doctrine\MongoDB\Aggregation\Expr
return Operator

max() public method

Returns the highest value that results from applying an expression to each document in a group of documents that share the same group by key.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/max/
See also: Expr::max
public max ( mixed | Expr $expression ) : Operator
$expression mixed | Doctrine\MongoDB\Aggregation\Expr
return Operator

min() public method

Returns the lowest value that results from applying an expression to each document in a group of documents that share the same group by key.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/min/
See also: Expr::min
public min ( mixed | Expr $expression ) : Operator
$expression mixed | Doctrine\MongoDB\Aggregation\Expr
return Operator

push() public method

Returns an array of all values that result from applying an expression to each document in a group of documents that share the same group by key.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/push/
See also: Expr::push
public push ( mixed | Expr $expression ) : Operator
$expression mixed | Doctrine\MongoDB\Aggregation\Expr
return Operator

stdDevPop() public method

The argument can be any expression as long as it resolves to an array.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/stdDevPop/
See also: Expr::stdDevPop
Since: 1.3
public stdDevPop ( mixed | Expr $expression )
$expression mixed | Doctrine\MongoDB\Aggregation\Expr

stdDevSamp() public method

The argument can be any expression as long as it resolves to an array.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/stdDevSamp/
See also: Expr::stdDevSamp
Since: 1.3
public stdDevSamp ( mixed | Expr $expression )
$expression mixed | Doctrine\MongoDB\Aggregation\Expr

sum() public method

Calculates and returns the sum of all the numeric values that result from applying a specified expression to each document in a group of documents that share the same group by key. Ignores nun-numeric values.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/sum/
See also: Expr::sum
public sum ( mixed | Expr $expression ) : Operator
$expression mixed | Doctrine\MongoDB\Aggregation\Expr
return Operator

Property Details

$expr protected_oe property

protected Expr,Doctrine\MongoDB\Aggregation $expr
return Doctrine\MongoDB\Aggregation\Expr