@@ -151,6 +151,94 @@ Version 5.0 Breaking Changes
151
151
responding in the same way as ``Decimal128`` values. In particular,
152
152
``BsonDecimal128.isNumber()`` now returns ``true``, and
153
153
``BsonDecimal128.asNumber()`` returns the equivalent ``BsonNumber``.
154
+ - This driver version removes the ``Parameterizable`` interface. Instead of
155
+ implementing this interface on a custom ``Codec`` type,
156
+ override the ``CodecProvider.get()`` method on the
157
+ codec's ``CodecProvider`` if the codec is intended for a parameterized
158
+ type.
159
+
160
+ - This driver version removes the ``isSlaveOk()`` method from the
161
+ ``ReadPreference`` and ``TaggableReadPreference`` classes. To check whether a read preference allows
162
+ reading from a secondary member of a replica set, use the ``isSecondaryOk()`` methods from
163
+ these classes instead.
164
+
165
+ - This driver version removes the ``DBCollection.getStats()`` and ``DBCollection.isCapped()``
166
+ helper methods for the ``collStats`` command. Instead of these methods, you can use the
167
+ ``$collStats`` aggregation pipeline stage. For an example of how to use this pipeline
168
+ stage, see `What's New <java-deprecations-4.11>` for v4.11 of the {+driver-short+}.
169
+
170
+ - This driver version removes the ``IterableCodec`` and ``MapCodec`` types.
171
+ Use ``MapCodecProvider`` instead of ``MapCodec`` and ``CollectionCodecProvider``
172
+ instead of ``IterableCodec``.
173
+
174
+ - This driver version removes the ``sharded`` and ``nonAtomic`` options from the
175
+ ``MapReducePublisher`` and ``MapReduceIterable`` classes.
176
+
177
+ - This driver version removes the following methods for use with ``geoHaystack`` indexes:
178
+
179
+ - ``Indexes.geoHaystack()``
180
+ - ``IndexOptions.getBucketSize()``
181
+ - ``IndexOptions.bucketSize()``
182
+
183
+ Instead, you can use the ``$geoNear`` aggregation pipeline stage or a geospatial
184
+ query operator on a 2d index. For more information about geospatial queries, see the
185
+ `Server manual <https://www.mongodb.com/docs/manual/geospatial-queries/#geospatial-queries-1>`__.
186
+
187
+ - This driver version removes the ``oplogReplay`` option from find operations. This
188
+ includes the following methods:
189
+
190
+ - ``DBCursor.oplogReplay()``
191
+ - ``DBCollectionFindOptions.isOplogReplay()``
192
+ - ``DBCollectionFindOptions.oplogReplay()``
193
+ - ``FindPublisher.oplogReplay()``
194
+ - ``FindIterable.oplogReplay()``
195
+
196
+ - This driver version removes the following ``Exception`` constructors:
197
+
198
+ - ``MongoBulkWriteException(BulkWriteResult, List<BulkWriteError>, WriteConcernError, ServerAddress)``
199
+ - ``MongoCursorNotFoundException(long, ServerAddress)``
200
+ - ``MongoQueryException(ServerAddress, int, String)``
201
+ - ``MongoQueryException(ServerAddress, int, String, String)``
202
+ - ``MongoQueryException(MongoCommandException)``
203
+
204
+ - This driver version removes the following overloads for the
205
+ ``BulkWriteResult.acknowledged()`` method:
206
+
207
+ - ``acknowledged(Type, int, List<BulkWriteUpsert>)``
208
+ - ``acknowledged(Type, int, Integer, List<BulkWriteUpsert>)``
209
+ - ``acknowledged(int, int, int, Integer, List<BulkWriteUpsert>)<String>)``
210
+
211
+ - This driver version removes the following ``ChangeStreamDocument`` constructors:
212
+
213
+ - ``ChangeStreamDocument(String, BsonDocument, BsonDocument, BsonDocument, TDocument, TDocument, BsonDocument, ...)``
214
+ - ``ChangeStreamDocument(String, BsonDocument, BsonDocument, BsonDocument, TDocument, BsonDocument, BsonTimestamp, ...)``
215
+ - ``ChangeStreamDocument(OperationType, BsonDocument, BsonDocument, BsonDocument, TDocument, BsonDocument, BsonTimestamp, ...)``
216
+
217
+ - This driver version removes the following constructors for events:
218
+
219
+ - ``CommandEvent(RequestContext, int, ConnectionDescription, String)``
220
+ - ``CommandEvent(int, ConnectionDescription, String)``
221
+ - ``CommandEvent(RequestContext, long, int, ConnectionDescription, String)``
222
+ - ``CommandFailedEvent(RequestContext, int, ConnectionDescription, String, long, Throwable)``
223
+ - ``CommandFailedEvent(int, ConnectionDescription, String, long, Throwable)``
224
+ - ``CommandStartedEvent(RequestContext, int, ConnectionDescription, String, String, BsonDocument)``
225
+ - ``CommandStartedEvent(int, ConnectionDescription, String, String, BsonDocument)``
226
+ - ``CommandSucceededEvent(RequestContext, int, ConnectionDescription, String, BsonDocument, long)``
227
+ - ``CommandSucceededEvent(int, ConnectionDescription, String, BsonDocument, long)``
228
+ - ``ConnectionCheckedInEvent(ConnectionId)``
229
+ - ``ConnectionCheckedOutEvent(ConnectionId, long)``
230
+ - ``ConnectionCheckedOutEvent(ConnectionId)``
231
+ - ``ConnectionCheckOutFailedEvent(ServerId, long, Reason)``
232
+ - ``ConnectionCheckOutFailedEvent(ServerId, Reason)``
233
+ - ``ConnectionCheckOutStartedEvent(ServerId)``
234
+ - ``ConnectionReadyEvent(ConnectionId)``
235
+ - ``ServerHeartbeatFailedEvent(ConnectionId, long, Throwable)``
236
+ - ``ServerHeartbeatSucceededEvent(ConnectionId, BsonDocument, long)``
237
+
238
+ - This driver version removes the ``errorLabels`` option from the ``WriteConcernError``
239
+ class. This includes the ``addLabel()`` and ``getErrorLabels()`` methods and the
240
+ constructor that includes an ``errorLabels`` parameter. Instead, you can use
241
+ the error labels included in the top-level response document.
154
242
155
243
.. _java-breaking-changes-v4.8:
156
244
0 commit comments