executeCommand() public method

Execute Mongo command
public executeCommand ( array $command, array $options = [] ) : array
$command array
$options array
return array
Example #1
0
 public function explainAggregate($pipeline)
 {
     if (version_compare($this->getDatabase()->getClient()->getDbVersion(), '2.6.0', '<')) {
         throw new Exception('Explain of aggregation implemented only from 2.6.0');
     }
     if ($pipeline instanceof Pipeline) {
         $pipeline = $pipeline->toArray();
     } elseif (!is_array($pipeline)) {
         throw new Exception('Wrong pipeline specified');
     }
     // aggregate
     return $this->_database->executeCommand(array('aggregate' => $this->getName(), 'pipeline' => $pipeline, 'explain' => true));
 }