Esempio n. 1
0
 public function testUnwindStage()
 {
     $unwindStage = new Unwind($this->getTestAggregationBuilder(), 'fieldName');
     $this->assertSame(array('$unwind' => 'fieldName'), $unwindStage->getExpression());
 }
Esempio 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());
 }