- The
getServer()
method has been removed from the CommandFailedEvent, CommandStartedEvent, and CommandSucceededEvent event classes. ThegetHost()
andgetPort()
methods have been added in its place. - The BSON functions in the
MongoDB\BSON
namespace have been removed in favor of theMongoDB\BSON\Document
class. - The constants
MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW
andMongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW
have been removed. Use theALGORITHM_RANGE
andQUERY_TYPE_RANGE
instead. - The
MongoDB\Driver\ReadPreference
class now requires a string value for its constructor's$mode
parameter. The integer constants for modes have been removed along with thegetMode()
method. Use the string constants andgetModeString()
instead. - All tentative return types defined in interface and non-final classes are now fixed and are required in implementing or extending classes.
MongoDB\Driver\CursorInterface
now extendsIterator
, requiring implementing classes to also implement iterator methods. The return types for thekey
andcurrent
methods have been narrowed to the types returned by cursor instances.- The
MongoDB\Driver\CursorId
class was removed.MongoDB\Driver\Cursor::getId()
andMongoDB\Driver\CursorInterface::getId()
now return aMongoDB\BSON\Int64
instance. - The
--with-libbson
and--with-libmongoc
configure options have been removed. Use--with-mongodb-system-libs
instead. - All classes that previously implemented the
Serializable
interface no longer implement this interface. - The constructor of
MongoDB\BSON\UTCDateTime
no longer accepts astring
orfloat
argument. To pass 64-bit integers on 32-bit platforms, use theMongoDB\BSON\Int64
class instead. - The
--with-openssl-dir
configure option has been removed. If using OpenSSL, ensure that it is detected bypkg-config
. - The
--with-system-ciphers
configure option has been removed. Use--enable-mongodb-crypto-system-profile
instead. MongoDB\Driver\Query
removes the following options:partial
(useallowPartialResults
instead),maxScan
,modifiers
(use alternative top-level options instead),oplogReplay
, andsnapshot
. Support for negativelimit
values has been removed (usesingleBatch
instead).- The
MongoDB\Driver\Manager
constructor now throws if the URI options array includes a non-boolean value for an option expecting a boolean. This behavior is now consistent with validation for other option types. - Removed the following driver options from
MongoDB\Driver\Manager
:allow_invalid_hostname
(usetlsAllowInvalidHostnames
URI option instead),ca_file
(usetlsCAFile
),context
,pem_file
(usetlsCertificateKeyFile
),pem_pwd
(usetlsCertificateKeyFilePassword
), andweak_cert_validation
(usetlsAllowInvalidCertificates
).