Exemplo n.º 1
0
 public function testUnwindStage()
 {
     $unwindStage = new Unwind($this->getTestAggregationBuilder(), 'fieldName');
     $this->assertSame(array('$unwind' => 'fieldName'), $unwindStage->getExpression());
 }
Exemplo n.º 2
0
 public function testUnwindStageWithNewFields()
 {
     $unwindStage = new Unwind($this->getTestAggregationBuilder(), 'fieldName');
     $unwindStage->preserveNullAndEmptyArrays()->includeArrayIndex('index');
     $this->assertSame(array('$unwind' => array('path' => 'fieldName', 'includeArrayIndex' => 'index', 'preserveNullAndEmptyArrays' => true)), $unwindStage->getExpression());
 }