Phalcon\Db\Adapter\MongoDB\Operation\ListIndexes::execute PHP Method

execute() public method

Execute the operation.
See also: Executable::execute()
public execute ( MongoDB\Driver\Server $server ) : Phalcon\Db\Adapter\MongoDB\Model\IndexInfoIterator
$server MongoDB\Driver\Server
return Phalcon\Db\Adapter\MongoDB\Model\IndexInfoIterator
    public function execute(Server $server)
    {
        return Functions::serverSupportsFeature($server, self::$wireVersionForCommand) ? $this->executeCommand($server) : $this->executeLegacy($server);
    }

Usage Example

Beispiel #1
0
 /**
  * Returns information for all indexes for the collection.
  *
  * @see ListIndexes::__construct() for supported options
  * @return IndexInfoIterator
  */
 public function listIndexes(array $options = [])
 {
     $operation = new ListIndexes($this->databaseName, $this->collectionName, $options);
     $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));
     return $operation->execute($server);
 }