PHP Conference Japan 2024

MongoDB\Driver\Monitoring\CommandStartedEvent::getServerConnectionId

(mongodb >=1.14.0)

MongoDB\Driver\Monitoring\CommandStartedEvent::getServerConnectionId傳回命令的伺服器連線 ID

說明

final public MongoDB\Driver\Monitoring\CommandStartedEvent::getServerConnectionId(): ?int

傳回指令的伺服器連線 ID。伺服器連線 ID 與伺服器(即 MongoDB\Driver\Monitoring\CommandStartedEvent::getServer())不同,並在 MongoDB 4.2+ 的 hello 指令回應的「connectionId」欄位中傳回。

參數

此函式沒有參數。

傳回值

傳回伺服器連線 ID,如果無法取得則傳回 null

錯誤/例外

新增註記

使用者貢獻的註記

此頁面沒有使用者貢獻的註記。
To Top