コード例 #1
0
ファイル: UnwindTest.php プロジェクト: Wizkunde/mongodb
 public function testUnwindStage()
 {
     $unwindStage = new Unwind($this->getTestAggregationBuilder(), 'fieldName');
     $this->assertSame(array('$unwind' => 'fieldName'), $unwindStage->getExpression());
 }
コード例 #2
0
ファイル: UnwindTest.php プロジェクト: malukenho/mongodb
 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());
 }