/**
* Execute the operation.
*
* For servers < 2.6, this will actually perform an insert operation on the
* database's "system.indexes" collection.
*
* @see Executable::execute()
*
* @param Server $server
*
* @return string[] The names of the created indexes
*/
public function execute(Server $server)
{
if (Functions::serverSupportsFeature($server, self::$wireVersionForCommand)) {
$this->executeCommand($server);
} else {
$this->executeLegacy($server);
}
return array_map(function (IndexInput $index) {
return (string) $index;
}, $this->indexes);
}