public function aggregateCursor(array $pipeline, array $options = [])
    {
        // Build command manually, can't use mongo-php-library here
        $command = [
            'aggregate' => $this->name,
            'pipeline' => $pipeline
        ];

        // Convert cursor option
        if (! isset($options['cursor'])) {
            $options['cursor'] = new \stdClass();
        }

        $command += $options;

        $cursor = new MongoCommandCursor($this->db->getConnection(), (string) $this, $command);
        $cursor->setReadPreference($this->getReadPreference());

        return $cursor;
    }
public function aggregateCursor(array $pipeline, array $options = [])
    {
        // Build command manually, can't use mongo-php-library here
        $command = [
            'aggregate' => $this->name,
            'pipeline' => $pipeline
        ];

        // Convert cursor option
        if (! isset($options['cursor'])) {
            $options['cursor'] = new \stdClass();
        }

        $command += $options;

        $cursor = new MongoCommandCursor($this->db->getConnection(), (string) $this, $command);
        $cursor->setReadPreference($this->getReadPreference());

        return $cursor;
    }
public function aggregateCursor ( array $ pipeline , array $ options = [ ] ) { // Build command manually, can't use mongo-php-library here $ command = [ 'aggregate' => $ this -> name , 'pipeline' => $ pipeline ] ; // Convert cursor option if ( ! isset ( $ options [ 'cursor' ] ) ) { $ options [ 'cursor' ] = new \ stdClass ( ) ; } $ command += $ options ; $ cursor = new MongoCommandCursor ( $ this -> db -> getConnection ( ) , ( string ) $ this , $ command ) ; $ cursor -> setReadPreference ( $ this -> getReadPreference ( ) ) ; return $ cursor ; }
Execute an aggregation pipeline command and retrieve results through a cursor

@link http://php.net/manual/en/mongocollection.aggregatecursor.php
@param array $pipeline
@param array $options
@return MongoCommandCursor
Execute an aggregation pipeline command and retrieve results through a cursor