Skip to content

Commit e354d89

Browse files
committed
JY review
1 parent ebbd07e commit e354d89

File tree

2 files changed

+64
-85
lines changed

2 files changed

+64
-85
lines changed

source/upgrade.txt

Lines changed: 35 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -61,51 +61,58 @@ 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.
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.
7070

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.
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.
7474

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.
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
79+
your binary.
7980

80-
<<<<<<< HEAD
8181
- The following record annotations from the
8282
``org.bson.codecs.record.annotations`` package are replaced with
8383
annotations of the same name from the ``org.bson.codecs.pojo.annotations`` package:
8484

8585
- ``BsonId``
8686
- ``BsonProperty``
8787
- ``BsonRepresentation``
88-
=======
89-
- This driver version removes the following record annotations:
88+
89+
- This driver version removes the ``Filters.eqFull()`` method, released
90+
exclusively in ``Beta``, which allowed you
91+
to construct an equality filter when performing a vector search.
92+
You can use the ``Filters.eq()`` method when instantiating a
93+
``VectorSearchOptions`` type, as shown in the following code:
94+
95+
.. code-block:: java
9096

91-
- ``BsonId``
92-
- ``BsonProperty``
93-
- ``BsonRepresentation``
94-
>>>>>>> 33ab215 (tech review)
97+
VectorSearchOptions opts = vectorSearchOptions().filter(eq("x", 8));
98+
99+
.. _java-breaking-changes-v5.0-observables:
100+
101+
- The ``getServerValue()`` method now returns a value of type ``Long`` instead of type
102+
``Integer``. Similarly, the ``getLocalValue()`` method returns a value of type
103+
``long`` instead of type ``int``. Because this change breaks both binary and source
104+
compatibility, update any source code that uses these methods and rebuild your binary.
95105

96106
- You must pass a timeout duration, which is the first parameter, to the
97107
following ``SocketSettings`` builder methods as a ``long`` type:
98108

99109
- ``connectTimeout()``
100110
- ``readTimeout()``
101111

102-
<<<<<<< HEAD
103-
In earlier versions, this parameter is of type ``int`` for both methods. To view an example
104-
that shows how to call ``SocketSettings`` methods, see the :ref:`SocketSettings Example
105-
<java-socketsettings-example>` in the Specify MongoClient Settings
106-
guide.
107-
108-
This change breaks binary compatibility (requires recompiling) but does not
112+
In earlier versions, this parameter is of type ``int`` for both methods. To view an example
113+
that shows how to call ``SocketSettings`` methods, see the :ref:`SocketSettings Example
114+
<java-socketsettings-example>` in the Specify MongoClient Settings
115+
guide. This change breaks binary compatibility (requires recompiling) but does not
109116
require code changes.
110117

111118
- This driver version removes the ``Filters.eqFull()`` method, released
@@ -117,26 +124,9 @@ Version 5.0 Breaking Changes
117124
.. code-block:: java
118125

119126
VectorSearchOptions opts = vectorSearchOptions().filter(eq("x", 8));
120-
=======
121-
In earlier versions, this parameter is of type ``int`` for both methods. To view an example
122-
that shows how to instantiate a ``SocketSettings`` instance by using
123-
these methods, see the :ref:`SocketSettings Example
124-
<java-socketsettings-example>` in the Specify MongoClient Settings
125-
guide.
126-
127-
- This driver version removes the ``Filters.eqFull()`` method, which allowed you
128-
to construct an equality filter when performing a vector search.
129-
You can use the ``Filters.eq()`` method when instantiating a
130-
``VectorSearchOptions`` type, as shown in the following code:
131127

132-
.. code-block:: java
133-
134-
VectorSearchOptions opts = vectorSearchOptions().filter(eq("x", 8));
135-
>>>>>>> 33ab215 (tech review)
128+
.. _java-breaking-changes-v5.0-observables:
136129

137-
.. _java-breaking-changes-v5.0-observables:
138-
139-
<<<<<<< HEAD
140130
- This driver version removes the
141131
``org.mongodb.scala.ObservableImplicits.ToSingleObservableVoid`` implicit
142132
class. This means the ``org.reactivestreams.Publisher[Void]`` type no longer
@@ -146,17 +136,6 @@ Version 5.0 Breaking Changes
146136

147137
.. After the 5.0 Scala API docs are released, this line will be uncommented.
148138
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>`__.
149-
=======
150-
- This driver version removes the
151-
``org.mongodb.scala.ObservableImplicits.ToSingleObservableVoid`` implicit
152-
class. This means the ``org.reactivestreams.Publisher[Void]`` type no longer
153-
converts automatically to ``org.mongodb.scala.SingleObservable[Void]``. The also
154-
API exposes ``org.mongodb.scala.Observable[Unit]`` instead of
155-
``org.mongodb.scala.Observable[Void]``.
156-
157-
.. After the 5.0 Scala API docs are released, this line will be uncommented.
158-
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>`__.
159-
>>>>>>> 33ab215 (tech review)
160139

161140
- This driver changes how ``ClusterSettings`` computes
162141
``ClusterConnectionMode``, making it more consistent by using the specified

source/whats-new.txt

Lines changed: 29 additions & 29 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
43+
.. warning:: Breaking Changes in v5.0
4444

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

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

0 commit comments

Comments
 (0)