Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions source/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -289,18 +289,18 @@ This driver version introduces the following breaking changes:
code using these methods must be recompiled. This change does not require any
changes to source code.

- Removes the following methods and types related to the
`StreamFactory
<https://mongodb.github.io/mongo-java-driver/4.11/apidocs/mongodb-driver-core/com/mongodb/connection/StreamFactory.html>`__

- Removes the following methods and types related to the
- Removes the following methods and types related to the
`Stream
<https://mongodb.github.io/mongo-java-driver/4.11/apidocs/mongodb-driver-core/com/mongodb/connection/Stream.html>`__
interface:
Copy link
Member Author

@stIncMale stIncMale Feb 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This duplication probably happened as a result of (presumably) rebasing and manually resolving non-trivial conflicts in #513 after the review had been completed.


- ``streamFactoryFactory()`` method from ``MongoClientSettings.Builder``
- ``getStreamFactoryFactory()`` method from ``MongoClientSettings``
- ``NettyStreamFactoryFactory`` class
- ``streamFactoryFactory()`` method from ``MongoClientSettings.Builder``.
Use the ``MongoClientSettings.Builder.transportSettings()`` method instead.
- ``getStreamFactoryFactory()`` method from ``MongoClientSettings``.
Use the ``MongoClientSettings.getTransportSettings()`` method instead.
- ``NettyStreamFactoryFactory`` class.
Use the ``NettyTransportSettings``, creatable by ``TransportSettings.nettyBuilder()``
and applied through ``MongoClientSettings.Builder.transportSettings()``.
- ``NettyStreamFactory`` class
- ``AsynchronousSocketChannelStreamFactory`` class
- ``AsynchronousSocketChannelStreamFactoryFactory`` class
Expand Down
54 changes: 41 additions & 13 deletions source/whats-new.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,37 +40,65 @@ Learn what's new in:
What's New in 5.0
-----------------

.. warning:: Breaking Changes in v5.0
.. warning:: Breaking changes in this release
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with the What's New sections for previous releases, this should be left as it is.

Suggested change
.. warning:: Breaking changes in this release
.. warning:: Breaking Changes in v5.0

Copy link
Member Author

@stIncMale stIncMale Feb 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the warning about deprecations in 4.11 (the latest release at the moment) uses the "Deprecations in this release" wording. This suggests that the wording was changed since release 4.8, where the wording is "Breaking Changes in v4.8". @rachel-mack Are you sure the old wording should be used again?


This driver version introduces breaking changes. For a list of these changes, see
the :ref:`Version 5.0 Breaking Changes section <java-breaking-changes-v5.0>` in the
Upgrade guide.

The 5.0 driver release introduces the following features:
.. warning:: Deprecations in this release

To avoid breaking changes in future major releases of the driver,
replace any application code that depends on deprecated program elements.

This section includes the following information:

- :ref:`java-deprecations-5.0`
- :ref:`java-behavioral-changes-5.0`
- :ref:`java-new-features-5.0`

.. _java-deprecations-5.0:

Deprecations in 5.0
~~~~~~~~~~~~~~~~~~~

- The ``org.mongodb.scala.Observable.completeWithUnit()`` method is deprecated.
This method is not useful anymore because
the driver now exposes ``org.mongodb.scala.Observable[Unit]``
instead of ``org.mongodb.scala.Observable[Void]``.
This relates to a :ref:`breaking change about Observables in this release
<java-breaking-changes-v5.0-observables>`.

.. _java-behavioral-changes-5.0:

Behavioral changes in 5.0
~~~~~~~~~~~~~~~~~~~~~~~~~

- The ``getElapsedTime()`` method on ``com.mongodb.event.ConnectionReadyEvent``
includes the time taken to deliver the ``ConnectionCreatedEvent``. That is,
the time returned includes the duration of the
``com.mongodb.event.ConnectionPoolListener.connectionCreated()`` method.

The ``getElapsedTime()`` methods on
``com.mongodb.event.ConnectionCheckedOutFailedEvent`` and
``com.mongodb.event.ConnectionCheckedOutEvent`` include the time taken to
deliver the ``com.mongodb.event.ConnectionCheckOutStartedEvent``. That is, the
time returned includes the duration of the
``com.mongodb.eventConnectionPoolListener.connectionCheckOutStarted()`` method.

- The ``org.mongodb.scala.Observable.completeWithUnit()`` method is deprecated.
This relates to a :ref:`breaking change about Observables in this version
<java-breaking-changes-v5.0-observables>`.
.. _java-new-features-5.0:

- Changes to the ``ConnectionId`` class. To learn more, see the
:ref:`Version 5.0 Breaking Changes <java-breaking-changes-v5.0>`.

- Changes to the ``com.mongodb.client.MongoDatabase.listCollectionNames()``
methods. The return type is now a
``com.mongodb.client.ListCollectionNamesIterable`` type, while previously it
was a ``MongoIterable<String>``. This change allows the return value to be
New features in 5.0
~~~~~~~~~~~~~~~~~~~

The 5.0 driver release introduces the following features:

- Adds support for the ``authorizedCollection`` option of
the ``listCollections`` command. This was done by changing the
``com.mongodb.client.MongoDatabase.listCollectionNames()`` methods.
The return type is now ``com.mongodb.client.ListCollectionNamesIterable``,
while previously it was a ``MongoIterable<String>``.
This change allows the return value to be
configured using the ``ListCollectionNamesIterable.authorizedCollections()``
method and specifying the ``authorizedCollections`` option. Equivalent changes
were made to following classes and interfaces:
Expand Down