Webiny\Component\Mongo\Mongo::aggregate PHP Method

aggregate() public method

public aggregate ( $collectionName, array $pipeline, array $options = [] )
$pipeline array
$options array
    public function aggregate($collectionName, array $pipeline, array $options = [])
    {
        return $this->bridge->aggregate($this->cName($collectionName), $pipeline, $options);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * This method does your query lookup and returns the result in form of an array.
  * In case if there are no records to return, false is returned.
  *
  * @return bool
  */
 public function getResult()
 {
     $result = $this->mongo->aggregate($this->getCollectionName(), $this->getPipeline());
     return $result->toArray();
 }