Пример #1
0
 /**
  * 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.
  *
  * @return Operator
  */
 public function sum($expression)
 {
     $this->expr->sum($expression);
     return $this;
 }
Пример #2
0
 /**
  * Returns the year portion of a date.
  *
  * The argument can be any expression as long as it resolves to a date.
  *
  * @see http://docs.mongodb.org/manual/reference/operator/aggregation/year/
  * @see Expr::year
  * @param mixed|Expr $expression
  * @return self
  */
 public function year($expression)
 {
     $this->expr->year($expression);
     return $this;
 }