Example #1
0
 /**
  * @see Collection::aggregate()
  */
 public function aggregate(array $pipeline, array $options = [])
 {
     if (!array_key_exists(0, $pipeline)) {
         $pipeline = func_get_args();
         $options = [];
     }
     $this->log(['aggregate' => true, 'pipeline' => $pipeline, 'options' => $options]);
     return parent::aggregate($pipeline, $options);
 }
Example #2
0
 /**
  * Executes the aggregation pipeline
  *
  * @param array $options
  * @return Iterator
  */
 public function execute($options = array())
 {
     return $this->collection->aggregate($this->getPipeline(), $options);
 }