diff --git a/source/fundamentals/databases-collections.txt b/source/fundamentals/databases-collections.txt index ed2213071..3a4f787c7 100644 --- a/source/fundamentals/databases-collections.txt +++ b/source/fundamentals/databases-collections.txt @@ -110,6 +110,8 @@ that specifies the validation rules and expressions: For more information, see the server documentation for :manual:`document validation `. +.. _java-collection-names: + Get a List of Collections ------------------------- diff --git a/source/upgrade.txt b/source/upgrade.txt index aba02f3cc..32f148984 100644 --- a/source/upgrade.txt +++ b/source/upgrade.txt @@ -66,7 +66,8 @@ Version 5.0 Breaking Changes - The ``ConnectionId`` constructor now accepts a value of type ``long`` as its second parameter instead of type ``int``. Similarly, the constructor now accepts a value of type ``Long`` as its third parameter instead of type ``Integer``. Because this change breaks - binary compatibility, recompile any existing code that calls the ``ConnectionId`` constructor. + binary compatibility, recompile any existing code that calls the + ``ConnectionId`` constructor. - The ``withServerValue()`` method now accepts a parameter of type ``long`` rather than type ``int``. This change breaks binary compatibility, so you must recompile any code @@ -152,6 +153,14 @@ Version 5.0 Breaking Changes ``BsonDecimal128.isNumber()`` now returns ``true``, and ``BsonDecimal128.asNumber()`` returns the equivalent ``BsonNumber``. +.. _java-breaking-changes-v5.0-list-collections: + +- This driver version adds support for a new ``authorizedCollection`` option of + the ``listCollections`` command. This introduces a breaking binary + change in the ``MongoDatabase.listCollectionNames()`` methods, meaning any + code using these methods must be recompiled. This change does not require any + changes to source code. + .. _java-breaking-changes-v4.8: Version 4.8 Breaking Changes diff --git a/source/whats-new.txt b/source/whats-new.txt index f0f25b207..197216468 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -66,7 +66,27 @@ The 5.0 driver release introduces the following features: - Changes to the ``ConnectionId`` class. To learn more, see the :ref:`Version 5.0 Breaking Changes `. - + +- Changes to the ``com.mongodb.client.MongoDatabase.listCollectionNames()`` + methods. The return type is now a + ``com.mongodb.client.ListCollectionNamesIterable`` type, while previously it + was a ``MongoIterable``. This change allows the return value to be + configured using the ``ListCollectionNamesIterable.authorizedCollections()`` + method and specifying the ``authorizedCollections`` option. Equivalent changes + were made to following classes and interfaces: + + - ``com.mongodb.reactivestreams.client.MongoDatabase`` + - ``org.mongodb.scala.MongoDatabase`` + - ``com.mongodb.kotlin.client.MongoDatabase`` + - ``com.mongodb.kotlin.client.coroutine.MongoDatabase`` + + These changes introduce a :ref:`binary breaking change to the listCollectionsNames() + method `. For more information + about the ``MongoDatabase.listCollectionNames()`` method and the + ``authorizedCollections`` option, see the + :manual:`listCollections ` Server manual + page or :ref:`java-collection-names`. + .. _version-4.11: What's New in 4.11