excludeIdField() public method

Shorthand method to exclude the _id field.
public excludeIdField ( boolean $exclude = true )
$exclude boolean
Example #1
0
 public function testProjectStage()
 {
     $projectStage = new Project($this->getTestAggregationBuilder());
     $projectStage->excludeIdField()->includeFields(array('$field', '$otherField'))->field('product')->multiply('$field', 5);
     $this->assertSame(array('$project' => array('_id' => false, '$field' => true, '$otherField' => true, 'product' => array('$multiply' => array('$field', 5)))), $projectStage->getExpression());
 }