PHP Conference Fukuoka 2025

MongoDB\Driver\Session::getServer

(mongodb >=1.6.0)

MongoDB\Driver\Session::getServer โ€” Returns the server to which this session is pinned

่ชฌๆ˜Ž

final public 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.

ใ‚จใƒฉใƒผ / ไพ‹ๅค–

๏ผ‹add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top