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