MongoDB\Driver\Server::getHost
Returns the hostname of this server
説明
final public string MongoDB\Driver\Server::getHost()
戻り値
Returns the hostname of this server.
エラー / 例外
- Throws MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors.
例
例1 MongoDB\Driver\Server::getHost example
<?php
$manager = new MongoDB\Driver\Manager("mongodb://localhost:27017/");
$server = $manager->selectServer();
var_dump($server->getHost());
?>
参考
- MongoDB\Driver\Server::getInfo
- MongoDB\Driver\ServerDescription::getHost