Php/docs/mongodb-driver-session.getserver

提供:Dev Guides
< Php
2020年12月14日 (月) 12:43時点におけるNotes (トーク | 投稿記録)による版 (autoload)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先:案内検索

MongoDB\Driver\Session::getServer

(mongodb >=1.6.0)

MongoDB\Driver\Session::getServerReturns the server to which this session is pinned


説明

final public MongoDB\Driver\Session::getServer ( ) : MongoDB\Driver\Server|null

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.


エラー / 例外