Skip to content

5.0 Removals #510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion snooty.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/"
[constants]
driver = "java"
driver-long = "MongoDB Java Driver"
driver-short = "Java Driver"
driver-short = "Java driver"
version = "4.11"
full-version = "{+version+}.1"
mdb-server = "MongoDB Server"
Expand Down
1 change: 0 additions & 1 deletion source/fundamentals/collations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ only binary comparison:

- :manual:`text </reference/method/db.collection.createIndex/#options-for-text-indexes>`
- :manual:`2d </reference/method/db.collection.createIndex/#options-for-2dsphere-indexes>`
- :manual:`geoHaystack </reference/method/db.collection.createIndex/#options-for-geohaystack-indexes>`

.. _collations-options:

Expand Down
93 changes: 91 additions & 2 deletions source/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,102 @@ Version 5.0 Breaking Changes
- This driver version removes the
``org.mongodb.scala.ObservableImplicits.ToSingleObservableVoid`` implicit
class. This means the ``org.reactivestreams.Publisher[Void]`` type no longer
converts automatically to ``org.mongodb.scala.SingleObservable[Void]``. The also
API exposes ``org.mongodb.scala.Observable[Unit]`` instead of
converts automatically to ``org.mongodb.scala.SingleObservable[Void]``. The
API also exposes ``org.mongodb.scala.Observable[Unit]`` instead of
``org.mongodb.scala.Observable[Void]``.

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

- This driver version removes the ``Parameterizable`` interface. Instead of
implementing this interface on a custom ``Codec`` type,
override the ``CodecProvider.get()`` method on the
codec's ``CodecProvider`` if the codec is intended for a parameterized
type.

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

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

- This driver version removes the ``IterableCodec`` and ``MapCodec`` types.
Use ``MapCodecProvider`` instead of ``MapCodec`` and ``CollectionCodecProvider``
instead of ``IterableCodec``.

- This driver version removes the ``sharded`` and ``nonAtomic`` options from the
``MapReducePublisher`` and ``MapReduceIterable`` classes.

- This driver version removes the following methods for use with ``geoHaystack`` indexes:

- ``Indexes.geoHaystack()``
- ``IndexOptions.getBucketSize()``
- ``IndexOptions.bucketSize()``

Instead, you can use the ``$geoNear`` aggregation pipeline stage or a geospatial
query operator on a 2d index. For more information, see the
:manual:`Geospatial Queries page </geospatial-queries>` in the {+mdb-server+} manual.

- This driver version removes the ``oplogReplay`` option from find operations. This
includes the following methods:

- ``DBCursor.oplogReplay()``
- ``DBCollectionFindOptions.isOplogReplay()``
- ``DBCollectionFindOptions.oplogReplay()``
- ``FindPublisher.oplogReplay()``
- ``FindIterable.oplogReplay()``

- This driver version removes the following ``Exception`` constructors:

- ``MongoBulkWriteException(BulkWriteResult, List<BulkWriteError>, WriteConcernError, ServerAddress)``
- ``MongoCursorNotFoundException(long, ServerAddress)``
- ``MongoQueryException(ServerAddress, int, String)``
- ``MongoQueryException(ServerAddress, int, String, String)``
- ``MongoQueryException(MongoCommandException)``

- This driver version removes the following overloads for the
``BulkWriteResult.acknowledged()`` method:

- ``acknowledged(Type, int, List<BulkWriteUpsert>)``
- ``acknowledged(Type, int, Integer, List<BulkWriteUpsert>)``
- ``acknowledged(int, int, int, Integer, List<BulkWriteUpsert>)<String>)``

- This driver version removes the following ``ChangeStreamDocument`` constructors:

- ``ChangeStreamDocument(String, BsonDocument, BsonDocument, BsonDocument, TDocument, TDocument, BsonDocument, ...)``
- ``ChangeStreamDocument(String, BsonDocument, BsonDocument, BsonDocument, TDocument, BsonDocument, BsonTimestamp, ...)``
- ``ChangeStreamDocument(OperationType, BsonDocument, BsonDocument, BsonDocument, TDocument, BsonDocument, BsonTimestamp, ...)``

- This driver version removes the following constructors for events:

- ``CommandEvent(RequestContext, int, ConnectionDescription, String)``
- ``CommandEvent(int, ConnectionDescription, String)``
- ``CommandEvent(RequestContext, long, int, ConnectionDescription, String)``
- ``CommandFailedEvent(RequestContext, int, ConnectionDescription, String, long, Throwable)``
- ``CommandFailedEvent(int, ConnectionDescription, String, long, Throwable)``
- ``CommandStartedEvent(RequestContext, int, ConnectionDescription, String, String, BsonDocument)``
- ``CommandStartedEvent(int, ConnectionDescription, String, String, BsonDocument)``
- ``CommandSucceededEvent(RequestContext, int, ConnectionDescription, String, BsonDocument, long)``
- ``CommandSucceededEvent(int, ConnectionDescription, String, BsonDocument, long)``
- ``ConnectionCheckedInEvent(ConnectionId)``
- ``ConnectionCheckedOutEvent(ConnectionId, long)``
- ``ConnectionCheckedOutEvent(ConnectionId)``
- ``ConnectionCheckOutFailedEvent(ServerId, long, Reason)``
- ``ConnectionCheckOutFailedEvent(ServerId, Reason)``
- ``ConnectionCheckOutStartedEvent(ServerId)``
- ``ConnectionReadyEvent(ConnectionId)``
- ``ServerHeartbeatFailedEvent(ConnectionId, long, Throwable)``
- ``ServerHeartbeatSucceededEvent(ConnectionId, BsonDocument, long)``

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

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

Version 4.8 Breaking Changes
Expand Down
7 changes: 3 additions & 4 deletions source/whats-new.txt
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,9 @@ What's New in 4.8

.. important:: Deprecation Notice

The ``IterableCodec`` and ``MapCodec`` classes are deprecated. Instead,
use ``CollectionCodec`` and ``MapCodecV2``.
These support any class that implements ``Collection`` or
``Map``.
The ``IterableCodec`` and ``MapCodec`` classes are deprecated.
Use ``MapCodecProvider`` instead of ``MapCodec`` and ``CollectionCodecProvider``
instead of ``IterableCodec``.

Behavioral changes with the 4.8 driver release include:

Expand Down