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