8000 [Java] Document breaking changes to listCollectionName methods and ne… · rustagir/docs-java@bc4d891 · GitHub
[go: up one dir, main page]

Skip to content

Commit bc4d891

Browse files
authored
[Java] Document breaking changes to listCollectionName methods and new authorizedCollections method (mongodb#516)
* authorizedCollections breaking change
1 parent 4d47ee9 commit bc4d891

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

source/fundamentals/databases-collections.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ that specifies the validation rules and expressions:
110110
For more information, see the server documentation for :manual:`document
111111
validation </core/document-validation>`.
112112

113+
.. _java-collection-names:
114+
113115
Get a List of Collections
114116
-------------------------
115117

source/upgrade.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ This driver version introduces the following breaking changes:
6868
- The ``ConnectionId`` constructor now accepts a value of type ``long`` as its second
6969
parameter instead of type ``int``. Similarly, the constructor now accepts a value of
7070
type ``Long`` as its third parameter instead of type ``Integer``. Because this change breaks
71-
binary compatibility, recompile any existing code that calls the ``ConnectionId`` constructor.
71+
binary compatibility, recompile any existing code that calls the
72+
``ConnectionId`` constructor.
7273

7374
- The ``withServerValue()`` method now accepts a parameter of type ``long`` rather than
7475
type ``int``. This change breaks binary compatibility, so you must recompile any code
@@ -280,6 +281,14 @@ This driver version introduces the following breaking changes:
280281
For more information about the events package, see the `com.mongodb.event
281282
package documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/package-summary.html>`__
282283

284+
.. _java-breaking-changes-v5.0-list-collections:
285+
286+
- This driver version adds support for a new ``authorizedCollection`` option of
287+
the ``listCollections`` command. This introduces a breaking binary
288+
change in the ``MongoDatabase.listCollectionNames()`` methods, meaning any
289+
code using these methods must be recompiled. This change does not require any
290+
changes to source code.
291+
283292
.. _java-breaking-changes-v4.8:
284293

285294
Version 4.8 Breaking Changes

source/whats-new.txt

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,27 @@ The 5.0 driver release introduces the following features:
6666

6767
- Changes to the ``ConnectionId`` class. To learn more, see the
6868
:ref:`Version 5.0 Breaking Changes <java-breaking-changes-v5.0>`.
69-
69+
70+
- Changes to the ``com.mongodb.client.MongoDatabase.listCollectionNames()``
71+
methods. The return type is now a
72+
``com.mongodb.client.ListCollectionNamesIterable`` type, while previously it
73+
was a ``MongoIterable<String>``. This change allows the return value to be
74+
configured using the ``ListCollectionNamesIterable.authorizedCollections()``
75+
method and specifying the ``authorizedCollections`` option. Equivalent changes
76+
were made to following classes and interfaces:
77+
78+
- ``com.mongodb.reactivestreams.client.MongoDatabase``
79+
- ``org.mongodb.scala.MongoDatabase``
80+
- ``com.mongodb.kotlin.client.MongoDatabase``
81+
- ``com.mongodb.kotlin.client.coroutine.MongoDatabase``
82+
83+
These changes introduce a :ref:`binary breaking change to the listCollectionsNames()
84+
method <java-breaking-changes-v5.0-list-collections>`. For more information
85+
about the ``MongoDatabase.listCollectionNames()`` method and the
86+
``authorizedCollections`` option, see the
87+
:manual:`listCollections </reference/command/listCollections/>` Server manual
88+
page or :ref:`java-collection-names`.
89+
7090
.. _version-4.11:
7191

7292
What's New in 4.11

0 commit comments

Comments
 (0)
0