php8.5
Home/ Manual/ driver / monitoring/ The MongoDB\Driver\Monitoring\ServerChangedEvent class

The MongoDB\Driver\Monitoring\ServerChangedEvent class

The MongoDB\Driver\Monitoring\ServerChangedEvent class encapsulates information about a changed server description. For example, a server's type changing from secondary to primary would cause its server description to change.

Intro

The MongoDB\Driver\Monitoring\ServerChangedEvent class encapsulates information about a changed server description. For example, a server's type changing from secondary to primary would cause its server description to change.

Class synopsis

class MongoDB\Driver\Monitoring\ServerChangedEvent { }

Properties

host

The hostname of the server.

port

The port of the server.

topologyId

The topology ID.

newDescription

The new server description.

previousDescription

The previous server description.

Changelog

VersionDescription
PECL mongodb 2.3.0Added public readonly properties.

Serverchangedevent

In this section

Source: reference/mongodb/mongodb/driver/monitoring/serverchangedevent.xml · from the official PHP manual (php/doc-en)