Doctrine\MongoDB\Query\Expr::each PHP Method

each() public method

Add $each criteria to the expression for a $push operation.
See also: Expr::push()
See also: http://docs.mongodb.org/manual/reference/operator/each/
public each ( array $values )
$values array
    public function each(array $values)
    {
        return $this->operator('$each', $values);
    }

Usage Example

Example #1
0
 public function testPushWithPosition()
 {
     $expr = new Expr();
     $innerExpr = new Expr();
     $innerExpr->each(array(20, 30))->position(0);
     $expectedNewObj = array('$push' => array('a' => array('$each' => array(20, 30), '$position' => 0)));
     $this->assertSame($expr, $expr->field('a')->push($innerExpr));
     $this->assertEquals($expectedNewObj, $expr->getNewObj());
 }
All Usage Examples Of Doctrine\MongoDB\Query\Expr::each