PHP Class Doctrine\MongoDB\Aggregation\Stage\Project

Since: 1.2
Author: alcaeus ([email protected])
Inheritance: extends Operator
Show file Open project: doctrine/mongodb Class Usage Examples

Public Methods

Method Description
avg ( mixed | Expr $expression1 ) : 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.
excludeIdField ( boolean $exclude = true ) Shorthand method to exclude the _id field.
getExpression ( )
includeFields ( array $fields ) Shorthand method to define which fields to be included.
max ( mixed | Expr $expression1 ) : 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 $expression1 ) : 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.
stdDevPop ( mixed | Expr $expression1 ) Calculates the population standard deviation of the input values.
stdDevSamp ( mixed | Expr $expression1 ) Calculates the sample standard deviation of the input values.
sum ( mixed | Expr $expression1 ) : 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

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
Since: 1.3
public avg ( mixed | Expr $expression1 ) : Operator
$expression1 mixed | Doctrine\MongoDB\Aggregation\Expr
return Operator

excludeIdField() public method

Shorthand method to exclude the _id field.
public excludeIdField ( boolean $exclude = true )
$exclude boolean

getExpression() public method

public getExpression ( )

includeFields() public method

Shorthand method to define which fields to be included.
public includeFields ( array $fields )
$fields array

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
Since: 1.3
public max ( mixed | Expr $expression1 ) : Operator
$expression1 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
Since: 1.3
public min ( mixed | Expr $expression1 ) : Operator
$expression1 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 $expression1 )
$expression1 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 $expression1 )
$expression1 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
Since: 1.3
public sum ( mixed | Expr $expression1 ) : Operator
$expression1 mixed | Doctrine\MongoDB\Aggregation\Expr
return Operator