Skip to content

Commit c76f560

Browse files
committed
JY review
1 parent 309894f commit c76f560

File tree

2 files changed

+89
-86
lines changed

2 files changed

+89
-86
lines changed

source/upgrade.txt

Lines changed: 55 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -61,60 +61,63 @@ the version after v4.0 including any listed under v4.5.
6161
Version 5.0 Breaking Changes
6262
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6363

64-
- This driver version introduces the following changes to the ``ConnectionId`` class:
65-
66-
- The ``ConnectionId`` constructor now accepts a value of type ``long`` as its second
67-
parameter instead of type ``int``. Similarly, the constructor now accepts a value of
68-
type ``Long`` as its third parameter instead of type ``Integer``. Because this change breaks
69-
binary compatibility, recompile any existing code that calls the ``ConnectionId`` constructor.
70-
71-
- The ``withServerValue()`` method now accepts a parameter of type ``long`` rather than
72-
type ``int``. This change breaks binary compatibility, so you must recompile any code
73-
that calls the ``withServerValue()`` method.
74-
75-
- The ``getServerValue()`` method now returns a value of type ``Long`` instead of type
76-
``Integer``. Similarly, the ``getLocalValue()`` method returns a value of type
77-
``long`` instead of type ``int``. Because this change breaks both binary and source
78-
compatibility, update any source code that uses these methods and rebuild your binary.
64+
- This driver version introduces the following changes to the ``ConnectionId`` class:
65+
66+
- The ``ConnectionId`` constructor now accepts a value of type ``long`` as its second
67+
parameter instead of type ``int``. Similarly, the constructor now accepts a value of
68+
type ``Long`` as its third parameter instead of type ``Integer``. Because this change breaks
69+
binary compatibility, recompile any existing code that calls the ``ConnectionId`` constructor.
70+
71+
- The ``withServerValue()`` method now accepts a parameter of type ``long`` rather than
72+
type ``int``. This change breaks binary compatibility, so you must recompile any code
73+
that calls the ``withServerValue()`` method.
74+
75+
- The ``getServerValue()`` method now returns a value of type ``Long`` instead of type
76+
``Integer``. Similarly, the ``getLocalValue()`` method returns a value of type
77+
``long`` instead of type ``int``. Because this change breaks both binary and source
78+
compatibility, update any source code that uses these methods and rebuild your binary.
79+
80+
- The following record annotations from the
81+
``org.bson.codecs.record.annotations`` package are replaced with
82+
annotations of the same name from the ``org.bson.codecs.pojo.annotations`` package:
83+
84+
- ``BsonId``
85+
- ``BsonProperty``
86+
- ``BsonRepresentation``
87+
88+
- You must pass a timeout duration, which is the first parameter, to the
89+
following ``SocketSettings`` builder methods as a ``long`` type:
90+
91+
- ``connectTimeout()``
92+
- ``readTimeout()``
93+
94+
In earlier versions, this parameter is of type ``int`` for both methods. To view an example
95+
that shows how to instantiate a ``SocketSettings`` instance by using
96+
these methods, see the :ref:`SocketSettings Example
97+
<java-socketsettings-example>` in the Specify MongoClient Settings
98+
guide.
99+
100+
- This driver version removes the ``Filters.eqFull()`` method, released
101+
exclusively in ``Beta``, which allowed you
102+
to construct an equality filter when performing a vector search.
103+
You can use the ``Filters.eq()`` method when instantiating a
104+
``VectorSearchOptions`` type, as shown in the following code:
79105

80-
- This driver version removes the following record annotations:
81-
82-
- ``BsonId``
83-
- ``BsonProperty``
84-
- ``BsonRepresentation``
85-
86-
- You must pass a timeout duration, which is the first parameter, to the
87-
following ``SocketSettings`` builder methods as a ``long`` type:
88-
89-
- ``connectTimeout()``
90-
- ``readTimeout()``
91-
92-
In earlier versions, this parameter is of type ``int`` for both methods. To view an example
93-
that shows how to instantiate a ``SocketSettings`` instance by using
94-
these methods, see the :ref:`SocketSettings Example
95-
<java-socketsettings-example>` in the Specify MongoClient Settings
96-
guide.
97-
98-
- This driver version removes the ``Filters.eqFull()`` method, which allowed you
99-
to construct an equality filter when performing a vector search.
100-
You can use the ``Filters.eq()`` method when instantiating a
101-
``VectorSearchOptions`` type, as shown in the following code:
102-
103-
.. code-block:: java
104-
105-
VectorSearchOptions opts = vectorSearchOptions().filter(eq("x", 8));
106-
107-
.. _java-breaking-changes-v5.0-observables:
108-
109-
- This driver version removes the
110-
``org.mongodb.scala.ObservableImplicits.ToSingleObservableVoid`` implicit
111-
class. This means the ``org.reactivestreams.Publisher[Void]`` type no longer
112-
converts automatically to ``org.mongodb.scala.SingleObservable[Void]``. The also
113-
API exposes ``org.mongodb.scala.Observable[Unit]`` instead of
114-
``org.mongodb.scala.Observable[Void]``.
106+
.. code-block:: java
115107

116-
.. After the 5.0 Scala API docs are released, this line will be uncommented.
117-
For more information, see the `Observable trait documentation <https://mongodb.github.io/mongo-java-driver/5.0/apidocs/mongo-scala-driver/org/mongodb/scala/Observable.html>`__.
108+
VectorSearchOptions opts = vectorSearchOptions().filter(eq("x", 8));
109+
110+
.. _java-breaking-changes-v5.0-observables:
111+
112+
- This driver version removes the
113+
``org.mongodb.scala.ObservableImplicits.ToSingleObservableVoid`` implicit
114+
class. This means the ``org.reactivestreams.Publisher[Void]`` type no longer
115+
converts automatically to ``org.mongodb.scala.SingleObservable[Void]``. The
116+
API also exposes ``org.mongodb.scala.Observable[Unit]`` instead of
117+
``org.mongodb.scala.Observable[Void]``.
118+
119+
.. After the 5.0 Scala API docs are released, this line will be uncommented.
120+
For more information, see the `Observable trait documentation <https://mongodb.github.io/mongo-java-driver/5.0/apidocs/mongo-scala-driver/org/mongodb/scala/Observable.html>`__.
118121

119122
.. _java-breaking-changes-v4.8:
120123

source/whats-new.txt

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -40,40 +40,40 @@ Learn what's new in:
4040
What's New in 5.0
4141
-----------------
4242

43-
.. warning:: Breaking Changes in v5.0
44-
45-
This driver version introduces breaking changes. For a list of these changes, see
46-
the :ref:`Version 5.0 Breaking Changes section <java-breaking-changes-v5.0>` in the
47-
Upgrade guide.
48-
49-
The 5.0 driver release introduces the following features:
50-
51-
- Consistent computation of the ``ClusterConnectionMode`` type after
52-
instantiating a ``ClusterSettings``. The connection mode defaults to
53-
``SINGLE`` if you specify one host and do not specify a replica set
54-
name, or it defaults to ``MULTIPLE`` if you specify more than one
55-
host.
56-
57-
- ``BsonDecimal128`` values respond to method calls in the same way as Java
58-
``Decimal128`` values. In particular, the error responses for the
59-
``isNumber()`` and ``asNumber()`` methods match the Java responses for
60-
equivalent ``Decimal128`` values.
61-
62-
- The ``getElapsedTime()`` method on ``com.mongodb.event.ConnectionReadyEvent``
63-
includes the time taken to deliver the ``ConnectionCreatedEvent``. That is,
64-
the time returned includes the duration of the
65-
``com.mongodb.event.ConnectionPoolListener.connectionCreated()`` method.
66-
67-
The ``getElapsedTime()`` methods on
68-
``com.mongodb.event.ConnectionCheckedOutFailedEvent`` and
69-
``com.mongodb.event.ConnectionCheckedOutEvent`` include the time taken to
70-
deliver the ``com.mongodb.event.ConnectionCheckOutStartedEvent``. That is, the
71-
time returned includes the duration of the
72-
``com.mongodb.eventConnectionPoolListener.connectionCheckOutStarted()`` method.
73-
74-
- The ``org.mongodb.scala.Observable.completeWithUnit()`` method is deprecated.
75-
This relates to a :ref:`breaking change about Observables in this version
76-
<java-breaking-changes-v5.0-observables>`.
43+
.. warning:: Breaking Changes in v5.0
44+
45+
This driver version introduces breaking changes. For a list of these changes, see
46+
the :ref:`Version 5.0 Breaking Changes section <java-breaking-changes-v5.0>` in the
47+
Upgrade guide.
48+
49+
The 5.0 driver release introduces the following features:
50+
51+
- Consistent computation of the ``ClusterConnectionMode`` type after
52+
instantiating a ``ClusterSettings``. The connection mode defaults to
53+
``SINGLE`` if you specify one host and do not specify a replica set
54+
name, or it defaults to ``MULTIPLE`` if you specify more than one
55+
host.
56+
57+
- ``BsonDecimal128`` values respond to method calls in the same way as Java
58+
``Decimal128`` values. In particular, the error responses for the
59+
``isNumber()`` and ``asNumber()`` methods match the Java responses for
60+
equivalent ``Decimal128`` values.
61+
62+
- The ``getElapsedTime()`` method on ``com.mongodb.event.ConnectionReadyEvent``
63+
includes the time taken to deliver the ``ConnectionCreatedEvent``. That is,
64+
the time returned includes the duration of the
65+
``com.mongodb.event.ConnectionPoolListener.connectionCreated()`` method.
66+
67+
The ``getElapsedTime()`` methods on
68+
``com.mongodb.event.ConnectionCheckedOutFailedEvent`` and
69+
``com.mongodb.event.ConnectionCheckedOutEvent`` include the time taken to
70+
deliver the ``com.mongodb.event.ConnectionCheckOutStartedEvent``. That is, the
71+
time returned includes the duration of the
72+
``com.mongodb.eventConnectionPoolListener.connectionCheckOutStarted()`` method.
73+
74+
- The ``org.mongodb.scala.Observable.completeWithUnit()`` method is deprecated.
75+
This relates to a :ref:`breaking change about Observables in this version
76+
<java-breaking-changes-v5.0-observables>`.
7777

7878
.. _version-4.11:
7979

0 commit comments

Comments
 (0)