/** * Used to use an expression as field value. Can be any expression * * @see http://docs.mongodb.org/manual/meta/aggregation-quick-reference/#aggregation-expressions * @see Expr::expression * @param mixed|Expr $value * @return self */ public function expression($value) { $this->expr->expression($value); return $this; }
/** * @expectedException \LogicException */ public function testExpressionWithoutField() { $nestedExpr = new Expr(); $nestedExpr->field('dayOfMonth')->dayOfMonth('$dateField')->field('dayOfWeek')->dayOfWeek('$dateField'); $expr = new Expr(); $expr->expression($nestedExpr); }