unwind() public method

Deconstructs an array field from the input documents to output a document for each element. Each output document is the input document with the value of the array field replaced by the element.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/unwind/
public unwind ( string $fieldName ) : Doctrine\MongoDB\Aggregation\Stage\Unwind
$fieldName string The field to unwind. It is automatically prefixed with the $ sign
return Doctrine\MongoDB\Aggregation\Stage\Unwind
Example #1
0
 /**
  * {@inheritdoc}
  */
 public function unwind($fieldName)
 {
     $fieldName = $this->getDocumentPersister()->prepareFieldName($fieldName);
     return parent::unwind($fieldName);
 }
Example #2
0
 /**
  * Deconstructs an array field from the input documents to output a document
  * for each element. Each output document is the input document with the
  * value of the array field replaced by the element.
  *
  * @see http://docs.mongodb.org/manual/reference/operator/aggregation/unwind/
  *
  * @param string $fieldName The field to unwind. It is automatically prefixed with the $ sign
  * @return Stage\Unwind
  */
 public function unwind($fieldName)
 {
     return $this->builder->unwind($fieldName);
 }