« MongoDB\Driver\Session::getOperationTime
MongoDB\Driver\Session::getTransactionOptions »

MongoDB\Driver\Session::getServer

(mongodb >=1.6.0)

MongoDB\Driver\Session::getServer — Returns the server to which this session is pinned

説明

final public function MongoDB\Driver\Session::getServer(): ?MongoDB\Driver\Server

Returns the MongoDB\Driver\Server to which this session is pinned. If the session is not pinned to a server, null will be returned.

Session pinning is primarily used for sharded transactions, as all commands within a sharded transaction must be sent to the same mongos instance. This method is intended to be used by libraries built atop the extension to allow use of a pinned server instead of invoking server selection.

パラメータ

この関数にはパラメータはありません。

戻り値

Returns the MongoDB\Driver\Server to which this session is pinned, or null if the session is not pinned to any server.

エラー / 例外

関連キーワード:
MongoDB   Driver   pinned   server   session   Session   getServer   Server   used   sharded   getOperationTime   getTransactionOptions   mongodb   final   returned   pinning   primarily   transactions   commands   within   transaction   sent   mongos   instance   method
関連する関数・ページ:
mongodb-driver-session.endsession   mongodb-driver-session.construct   mongodb-driver-session.gettransactionstate   mongodb-driver-session.getoperationtime   mongodb-driver-session.getlogicalsessionid   class.mongodb-driver-session