Skip to content

Commit 5700e72

Browse files
mongoKartrachel-mack
authored andcommitted
rm/cc feedback
1 parent b3fa912 commit 5700e72

File tree

1 file changed

+55
-38
lines changed

1 file changed

+55
-38
lines changed

source/upgrade.txt

Lines changed: 55 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -61,32 +61,32 @@ 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.
64+
This driver version introduces the following breaking changes:
65+
66+
- Changes the data type of the timeout duration parameter in the
67+
``SocketSettings.Builder.connectTimeout()`` and ``SocketSettings.Builder.readTimeout()``
68+
methods. The data type of this parameter is now ``long`` instead of ``int``.
69+
To view an
70+
example that shows how to instantiate a ``SocketSettings`` instance by using
71+
these methods, see the :ref:`SocketSettings Example
72+
<java-socketsettings-example>` in the Specify MongoClient Settings
73+
guide.
7474

7575
- The ``getServerValue()`` method now returns a value of type ``Long`` instead of type
7676
``Integer``. Similarly, the ``getLocalValue()`` method returns a value of type
7777
``long`` instead of type ``int``. Because this change breaks both binary and source
7878
compatibility, update any source code that uses these methods and rebuild your binary.
7979

80-
- The following record annotations from the
81-
``org.bson.codecs.record.annotations`` package are replaced with
80+
- Removes the following record annotations from the
81+
``org.bson.codecs.record.annotations`` package are replaces them with
8282
annotations of the same name from the ``org.bson.codecs.pojo.annotations`` package:
8383

8484
- ``BsonId``
8585
- ``BsonProperty``
8686
- ``BsonRepresentation``
8787

88-
- You must pass a timeout duration, which is the first parameter, to the
89-
following ``SocketSettings`` builder methods as a ``long`` type:
88+
- Requires the timeout parameter to be passed to the
89+
following ``SocketSettings`` builder methods as a ``long`` types:
9090

9191
- ``connectTimeout()``
9292
- ``readTimeout()``
@@ -99,7 +99,7 @@ Version 5.0 Breaking Changes
9999
This change breaks binary compatibility (requires recompiling) but does not
100100
require code changes.
101101

102-
- This driver version removes the ``Filters.eqFull()`` method, released
102+
- Removes the ``Filters.eqFull()`` method, released
103103
exclusively in ``Beta``, which allowed you
104104
to construct an equality filter when performing a vector search.
105105
You can use the ``Filters.eq()`` method when instantiating a
@@ -110,18 +110,11 @@ Version 5.0 Breaking Changes
110110
VectorSearchOptions opts = vectorSearchOptions().filter(eq("x", 8));
111111

112112
.. _java-breaking-changes-v5.0-observables:
113-
114-
- This driver version removes the
115-
``org.mongodb.scala.ObservableImplicits.ToSingleObservableVoid`` implicit
116-
class. This means the ``org.reactivestreams.Publisher[Void]`` type no longer
117-
converts automatically to ``org.mongodb.scala.SingleObservable[Void]``. The
118-
API also exposes ``org.mongodb.scala.Observable[Unit]`` instead of
119-
``org.mongodb.scala.Observable[Void]``.
120113

121114
.. After the 5.0 Scala API docs are released, this line will be uncommented.
122115
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>`__.
123116

124-
- This driver changes how ``ClusterSettings`` computes
117+
- Changes how ``ClusterSettings`` computes
125118
``ClusterConnectionMode``, making it more consistent by using the specified
126119
replica set name, regardless of how it is configured. Previously, replica set
127120
name was only considered if it was set by the connection string.
@@ -147,34 +140,35 @@ Version 5.0 Breaking Changes
147140
.build()
148141
.getMode()
149142

150-
- This driver changes how ``BsonDecimal128`` values respond to method calls, by
143+
- Changes how ``BsonDecimal128`` values respond to method calls, by
151144
responding in the same way as ``Decimal128`` values. In particular,
152145
``BsonDecimal128.isNumber()`` now returns ``true``, and
153146
``BsonDecimal128.asNumber()`` returns the equivalent ``BsonNumber``.
154-
- This driver version removes the ``Parameterizable`` interface. Instead of
147+
148+
- Removes the ``Parameterizable`` interface. Instead of
155149
implementing this interface on a custom ``Codec`` type,
156150
override the ``CodecProvider.get()`` method on the
157151
codec's ``CodecProvider`` if the codec is intended for a parameterized
158152
type.
159153

160-
- This driver version removes the ``isSlaveOk()`` method from the
154+
- Removes the ``isSlaveOk()`` method from the
161155
``ReadPreference`` and ``TaggableReadPreference`` classes. To check whether a read preference allows
162156
reading from a secondary member of a replica set, use the ``isSecondaryOk()`` methods from
163157
these classes instead.
164158

165-
- This driver version removes the ``DBCollection.getStats()`` and ``DBCollection.isCapped()``
159+
- Removes the ``DBCollection.getStats()`` and ``DBCollection.isCapped()``
166160
helper methods for the ``collStats`` command. Instead of these methods, you can use the
167161
``$collStats`` aggregation pipeline stage. For an example of how to use this pipeline
168162
stage, see :manual:`What's New <java-deprecations-4.11>` for v4.11 of the {+driver-short+}.
169163

170-
- This driver version removes the ``IterableCodec`` and ``MapCodec`` types.
171-
Use ``MapCodecProvider`` instead of ``MapCodec`` and ``CollectionCodecProvider``
164+
- Removes the ``IterableCodec`` and ``MapCodec`` types.
165+
Use ``MapCodecProvider`` instead of ``MapCodec``, and ``CollectionCodecProvider``
172166
instead of ``IterableCodec``.
173167

174-
- This driver version removes the ``sharded`` and ``nonAtomic`` options from the
168+
- Removes the ``sharded`` and ``nonAtomic`` options from the
175169
``MapReducePublisher`` and ``MapReduceIterable`` classes.
176170

177-
- This driver version removes the following methods for use with ``geoHaystack`` indexes:
171+
- Removes the following methods for use with ``geoHaystack`` indexes:
178172

179173
- ``Indexes.geoHaystack()``
180174
- ``IndexOptions.getBucketSize()``
@@ -184,7 +178,7 @@ Version 5.0 Breaking Changes
184178
query operator on a 2d index. For more information, see the
185179
:manual:`Geospatial Queries page </geospatial-queries>` in the {+mdb-server+} manual.
186180

187-
- This driver version removes the ``oplogReplay`` option from find operations. This
181+
- Removes the ``oplogReplay`` option from find operations. This
188182
includes the following methods:
189183

190184
- ``DBCursor.oplogReplay()``
@@ -193,28 +187,27 @@ Version 5.0 Breaking Changes
193187
- ``FindPublisher.oplogReplay()``
194188
- ``FindIterable.oplogReplay()``
195189

196-
- This driver version removes the following ``Exception`` constructors:
190+
- Removes the following ``Exception`` constructors:
197191

198192
- ``MongoBulkWriteException(BulkWriteResult, List<BulkWriteError>, WriteConcernError, ServerAddress)``
199193
- ``MongoCursorNotFoundException(long, ServerAddress)``
200194
- ``MongoQueryException(ServerAddress, int, String)``
201195
- ``MongoQueryException(ServerAddress, int, String, String)``
202196
- ``MongoQueryException(MongoCommandException)``
203197

204-
- This driver version removes the following overloads for the
205-
``BulkWriteResult.acknowledged()`` method:
198+
- Removes the following overloads for the ``BulkWriteResult.acknowledged()`` method:
206199

207200
- ``acknowledged(Type, int, List<BulkWriteUpsert>)``
208201
- ``acknowledged(Type, int, Integer, List<BulkWriteUpsert>)``
209202
- ``acknowledged(int, int, int, Integer, List<BulkWriteUpsert>)<String>)``
210203

211-
- This driver version removes the following ``ChangeStreamDocument`` constructors:
204+
- Removes the following ``ChangeStreamDocument`` constructors:
212205

213206
- ``ChangeStreamDocument(String, BsonDocument, BsonDocument, BsonDocument, TDocument, TDocument, BsonDocument, ...)``
214207
- ``ChangeStreamDocument(String, BsonDocument, BsonDocument, BsonDocument, TDocument, BsonDocument, BsonTimestamp, ...)``
215208
- ``ChangeStreamDocument(OperationType, BsonDocument, BsonDocument, BsonDocument, TDocument, BsonDocument, BsonTimestamp, ...)``
216209

217-
- This driver version removes the following constructors for events:
210+
- Removes the following constructors for events:
218211

219212
- ``CommandEvent(RequestContext, int, ConnectionDescription, String)``
220213
- ``CommandEvent(int, ConnectionDescription, String)``
@@ -235,11 +228,35 @@ Version 5.0 Breaking Changes
235228
- ``ServerHeartbeatFailedEvent(ConnectionId, long, Throwable)``
236229
- ``ServerHeartbeatSucceededEvent(ConnectionId, BsonDocument, long)``
237230

238-
- This driver version removes the ``errorLabels`` option from the ``WriteConcernError``
231+
- Removes the ``errorLabels`` option from the ``WriteConcernError``
239232
class. This includes the ``addLabel()`` and ``getErrorLabels()`` methods and the
240233
constructor that includes an ``errorLabels`` parameter. Instead, you can use
241234
the error labels included in the top-level response document.
242235

236+
- Removes the
237+
``org.mongodb.scala.ObservableImplicits.ToSingleObservableVoid`` implicit
238+
class from the Scala driver package. This means the
239+
``org.reactivestreams.Publisher[Void]`` type no longer
240+
converts automatically to ``org.mongodb.scala.SingleObservable[Void]``. The
241+
API also exposes ``org.mongodb.scala.Observable[Unit]`` instead of
242+
``org.mongodb.scala.Observable[Void]``.
243+
244+
- Introduces the following changes to the ``ConnectionId`` class:
245+
246+
- The ``ConnectionId`` constructor now accepts a value of type ``long`` as its second
247+
parameter instead of type ``int``. Similarly, the constructor now accepts a value of
248+
type ``Long`` as its third parameter instead of type ``Integer``. Because this change breaks
249+
binary compatibility, recompile any existing code that calls the ``ConnectionId`` constructor.
250+
251+
- The ``withServerValue()`` method now accepts a parameter of type ``long`` rather than
252+
type ``int``. This change breaks binary compatibility, so you must recompile any code
253+
that calls the ``withServerValue()`` method.
254+
255+
- The ``getServerValue()`` method now returns a value of type ``Long`` instead of type
256+
``Integer``. Similarly, the ``getLocalValue()`` method returns a value of type
257+
``long`` instead of type ``int``. Because this change breaks both binary and source
258+
compatibility, update any source code that uses these methods and rebuild your binary.
259+
243260
.. _java-breaking-changes-v4.8:
244261

245262
Version 4.8 Breaking Changes

0 commit comments

Comments
 (0)