PHP Class Sokil\Mongo\Pipeline\GroupStage

Inheritance: implements Sokil\Mongo\ArrayableInterface
Afficher le fichier Open project: sokil/php-mongo

Méthodes publiques

Méthode Description
addToSet ( string $field, literal | callable | Sokil\Mongo\Pipeline\Expression $expression ) : GroupStage Add to set accumulator
avg ( string $field, literal | callable | Sokil\Mongo\Pipeline\Expression $expression ) : GroupStage Average accumulator
first ( string $field, literal | callable | Sokil\Mongo\Pipeline\Expression $expression ) : GroupStage 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.
last ( string $field, literal | callable | Sokil\Mongo\Pipeline\Expression $expression ) : GroupStage 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 ( string $field, literal | callable | Sokil\Mongo\Pipeline\Expression $expression ) : GroupStage 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 ( string $field, literal | callable | Sokil\Mongo\Pipeline\Expression $expression ) : GroupStage 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 ( string $field, literal | callable | Sokil\Mongo\Pipeline\Expression $expression ) : GroupStage 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.
setId ( $id )
sum ( string $field, literal | callable | Sokil\Mongo\Pipeline\Expression $expression ) : GroupStage Sum accumulator
toArray ( )

Method Details

addToSet() public méthode

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.
public addToSet ( string $field, literal | callable | Sokil\Mongo\Pipeline\Expression $expression ) : GroupStage
$field string
$expression literal | callable | Sokil\Mongo\Pipeline\Expression Expression
Résultat GroupStage

avg() public méthode

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. $avg ignores non-numeric values.
public avg ( string $field, literal | callable | Sokil\Mongo\Pipeline\Expression $expression ) : GroupStage
$field string
$expression literal | callable | Sokil\Mongo\Pipeline\Expression Expression
Résultat GroupStage

first() public méthode

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.
public first ( string $field, literal | callable | Sokil\Mongo\Pipeline\Expression $expression ) : GroupStage
$field string
$expression literal | callable | Sokil\Mongo\Pipeline\Expression Expression
Résultat GroupStage

last() public méthode

Only meaningful when documents are in a defined order.
public last ( string $field, literal | callable | Sokil\Mongo\Pipeline\Expression $expression ) : GroupStage
$field string
$expression literal | callable | Sokil\Mongo\Pipeline\Expression Expression
Résultat GroupStage

max() public méthode

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.
public max ( string $field, literal | callable | Sokil\Mongo\Pipeline\Expression $expression ) : GroupStage
$field string
$expression literal | callable | Sokil\Mongo\Pipeline\Expression Expression
Résultat GroupStage

min() public méthode

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.
public min ( string $field, literal | callable | Sokil\Mongo\Pipeline\Expression $expression ) : GroupStage
$field string
$expression literal | callable | Sokil\Mongo\Pipeline\Expression Expression
Résultat GroupStage

push() public méthode

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.
public push ( string $field, literal | callable | Sokil\Mongo\Pipeline\Expression $expression ) : GroupStage
$field string
$expression literal | callable | Sokil\Mongo\Pipeline\Expression Expression
Résultat GroupStage

setId() public méthode

public setId ( $id )

sum() public méthode

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. $sum ignores non-numeric values.
public sum ( string $field, literal | callable | Sokil\Mongo\Pipeline\Expression $expression ) : GroupStage
$field string
$expression literal | callable | Sokil\Mongo\Pipeline\Expression Expression
Résultat GroupStage

toArray() public méthode

public toArray ( )