From 0b44e3151239501e5fc9fbb323c43f85f5e29aec Mon Sep 17 00:00:00 2001 From: rustagir Date: Tue, 22 Oct 2024 13:38:38 -0400 Subject: [PATCH 1/3] DOCSP-43953: v2 iterator changes --- .../class/MongoDBModelCollectionInfo.txt | 4 ++-- .../MongoDBModelCollectionInfoIterator.txt | 20 ------------------- .../class/MongoDBModelDatabaseInfo.txt | 4 ++-- .../MongoDBModelDatabaseInfoIterator.txt | 20 ------------------- .../reference/class/MongoDBModelIndexInfo.txt | 4 ++-- .../class/MongoDBModelIndexInfoIterator.txt | 20 ------------------- .../method/MongoDBClient-listDatabases.txt | 10 ++++------ .../method/MongoDBCollection-listIndexes.txt | 9 ++++----- .../MongoDBDatabase-listCollections.txt | 10 ++++------ source/reference/result-classes.txt | 3 --- source/whats-new.txt | 12 +++++++++++ 11 files changed, 30 insertions(+), 86 deletions(-) delete mode 100644 source/reference/class/MongoDBModelCollectionInfoIterator.txt delete mode 100644 source/reference/class/MongoDBModelDatabaseInfoIterator.txt delete mode 100644 source/reference/class/MongoDBModelIndexInfoIterator.txt diff --git a/source/reference/class/MongoDBModelCollectionInfo.txt b/source/reference/class/MongoDBModelCollectionInfo.txt index 76b9af35..f4ada568 100644 --- a/source/reference/class/MongoDBModelCollectionInfo.txt +++ b/source/reference/class/MongoDBModelCollectionInfo.txt @@ -8,8 +8,8 @@ Definition .. phpclass:: MongoDB\Model\CollectionInfo This class models information about a collection. Instances of this class are - returned by traversing a :phpclass:`MongoDB\Model\CollectionInfoIterator`, - which is returned by :phpmethod:`MongoDB\Database::listCollections()`. + returned in an `Iterator <{+php-manual}/class.iterator.php>`__ + returned by :phpmethod:`MongoDB\Database::listCollections()`. .. versionchanged:: 1.4 diff --git a/source/reference/class/MongoDBModelCollectionInfoIterator.txt b/source/reference/class/MongoDBModelCollectionInfoIterator.txt deleted file mode 100644 index fca6da62..00000000 --- a/source/reference/class/MongoDBModelCollectionInfoIterator.txt +++ /dev/null @@ -1,20 +0,0 @@ -============================================ -MongoDB\\Model\\CollectionInfoIterator Class -============================================ - -Definition ----------- - -.. phpclass:: MongoDB\Model\CollectionInfoIterator - - This interface extends PHP's :php:`Iterator ` - interface. An instance of this interface is returned by - :phpmethod:`MongoDB\Database::listCollections()`. - -Methods -------- - -This interface adds no new methods to :php:`Iterator -`, but specifies that :php:`current() -` will return an instance of -:phpclass:`MongoDB\Model\CollectionInfo`. \ No newline at end of file diff --git a/source/reference/class/MongoDBModelDatabaseInfo.txt b/source/reference/class/MongoDBModelDatabaseInfo.txt index a8d18cd6..1a5aff7d 100644 --- a/source/reference/class/MongoDBModelDatabaseInfo.txt +++ b/source/reference/class/MongoDBModelDatabaseInfo.txt @@ -8,8 +8,8 @@ Definition .. phpclass:: MongoDB\Model\DatabaseInfo This class models information about a database. Instances of this class are - returned by traversing a :phpclass:`MongoDB\Model\DatabaseInfoIterator`, - which is returned by :phpmethod:`MongoDB\Client::listDatabases()`. + returned in an `Iterator <{+php-manual}/class.iterator.php>`__ + returned by :phpmethod:`MongoDB\Client::listDatabases()`. .. versionchanged:: 1.4 diff --git a/source/reference/class/MongoDBModelDatabaseInfoIterator.txt b/source/reference/class/MongoDBModelDatabaseInfoIterator.txt deleted file mode 100644 index ba36ef2e..00000000 --- a/source/reference/class/MongoDBModelDatabaseInfoIterator.txt +++ /dev/null @@ -1,20 +0,0 @@ -========================================== -MongoDB\\Model\\DatabaseInfoIterator Class -========================================== - -Definition ----------- - -.. phpclass:: MongoDB\Model\DatabaseInfoIterator - - This interface extends PHP's :php:`Iterator ` - interface. An instance of this interface is returned by - :phpmethod:`MongoDB\Client::listDatabases()`. - -Methods -------- - -This interface adds no new methods to :php:`Iterator -`, but specifies that :php:`current() -` will return an instance of -:phpclass:`MongoDB\Model\DatabaseInfo`. \ No newline at end of file diff --git a/source/reference/class/MongoDBModelIndexInfo.txt b/source/reference/class/MongoDBModelIndexInfo.txt index 257694d8..09805f50 100644 --- a/source/reference/class/MongoDBModelIndexInfo.txt +++ b/source/reference/class/MongoDBModelIndexInfo.txt @@ -8,8 +8,8 @@ Definition .. phpclass:: MongoDB\Model\IndexInfo This class models information about an index. Instances of this class are - returned by traversing a :phpclass:`MongoDB\Model\IndexInfoIterator`, - which is returned by :phpmethod:`MongoDB\Collection::listIndexes()`. + returned in an `Iterator <{+php-manual}/class.iterator.php>`__ + returned by :phpmethod:`MongoDB\Collection::listIndexes()`. This class implements PHP's :php:`ArrayAccess ` interface. This provides a mechanism for accessing index fields for which there exists no diff --git a/source/reference/class/MongoDBModelIndexInfoIterator.txt b/source/reference/class/MongoDBModelIndexInfoIterator.txt deleted file mode 100644 index 0fae59c2..00000000 --- a/source/reference/class/MongoDBModelIndexInfoIterator.txt +++ /dev/null @@ -1,20 +0,0 @@ -======================================= -MongoDB\\Model\\IndexInfoIterator Class -======================================= - -Definition ----------- - -.. phpclass:: MongoDB\Model\IndexInfoIterator - - This interface extends PHP's :php:`Iterator ` - interface. An instance of this interface is returned by - :phpmethod:`MongoDB\Collection::listIndexes()`. - -Methods -------- - -This interface adds no new methods to :php:`Iterator -`, but specifies that :php:`current() -` will return an instance of -:phpclass:`MongoDB\Model\IndexInfo`. \ No newline at end of file diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt index 93a4d65a..103fc39e 100644 --- a/source/reference/method/MongoDBClient-listDatabases.txt +++ b/source/reference/method/MongoDBClient-listDatabases.txt @@ -2,8 +2,6 @@ MongoDB\\Client::listDatabases() ================================ -.. default-domain:: mongodb - .. contents:: On this page :local: :backlinks: none @@ -19,7 +17,7 @@ Definition .. code-block:: php - function listDatabases(array $options = []): MongoDB\Model\DatabaseInfoIterator + function listDatabases(array $options = []): Iterator Parameters ---------- @@ -77,9 +75,9 @@ Parameters Return Values ------------- -A traversable :phpclass:`MongoDB\Model\DatabaseInfoIterator`, which contains -a :phpclass:`MongoDB\Model\DatabaseInfo` object for each database on the -server. +An `Iterator <{+php-manual}/class.iterator.php>`__ +instance, which contains a :phpclass:`MongoDB\Model\DatabaseInfo` object +for each database on the server. Errors/Exceptions ----------------- diff --git a/source/reference/method/MongoDBCollection-listIndexes.txt b/source/reference/method/MongoDBCollection-listIndexes.txt index c6d9d474..e3357f58 100644 --- a/source/reference/method/MongoDBCollection-listIndexes.txt +++ b/source/reference/method/MongoDBCollection-listIndexes.txt @@ -2,8 +2,6 @@ MongoDB\\Collection::listIndexes() ================================== -.. default-domain:: mongodb - .. contents:: On this page :local: :backlinks: none @@ -19,7 +17,7 @@ Definition .. code-block:: php - function listIndexes(array $options = []): MongoDB\Model\IndexInfoIterator + function listIndexes(array $options = []): Iterator Parameters ---------- @@ -56,8 +54,9 @@ Parameters Return Values ------------- -A traversable :phpclass:`MongoDB\Model\IndexInfoIterator`, which contains a -:phpclass:`MongoDB\Model\IndexInfo` object for each index for the collection. +An `Iterator <{+php-manual}/class.iterator.php>`__ +instance, which contains a :phpclass:`MongoDB\Model\IndexInfo` object +for each index for the collection. Errors/Exceptions ----------------- diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt index 511b8995..b6ee27c4 100644 --- a/source/reference/method/MongoDBDatabase-listCollections.txt +++ b/source/reference/method/MongoDBDatabase-listCollections.txt @@ -2,8 +2,6 @@ MongoDB\\Database::listCollections() ==================================== -.. default-domain:: mongodb - .. contents:: On this page :local: :backlinks: none @@ -19,7 +17,7 @@ Definition .. code-block:: php - function listCollections(array $options = []): MongoDB\Model\CollectionInfoIterator + function listCollections(array $options = []): Iterator Parameters ---------- @@ -74,9 +72,9 @@ Parameters Return Values ------------- -A traversable :phpclass:`MongoDB\Model\CollectionInfoIterator`, which contains -a :phpclass:`MongoDB\Model\CollectionInfo` object for each collection in the -database. +An `Iterator <{+php-manual}/class.iterator.php>`__ +instance, which contains a :phpclass:`MongoDB\Model\CollectionInfo` +object for each collection in the database. Example ------- diff --git a/source/reference/result-classes.txt b/source/reference/result-classes.txt index 8fb92ec2..7836b48f 100644 --- a/source/reference/result-classes.txt +++ b/source/reference/result-classes.txt @@ -12,8 +12,5 @@ Result Classes UpdateResult Class ChangeStream Class CollectionInfo Class - CollectionInfoIterator Class DatabaseInfo Class - DatabaseInfoIterator Class IndexInfo Class - IndexInfoIterator Class \ No newline at end of file diff --git a/source/whats-new.txt b/source/whats-new.txt index cd678c0a..89fedab5 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -96,6 +96,18 @@ improvements, and fixes: ` in the {+mdb-server+} manual. +- Removes the following ``Iterator`` implementations: + + - ``MongoDB\\Model\\CollectionInfoIterator`` + - ``MongoDB\\Model\\DatabaseInfoIterator`` + - ``MongoDB\\Model\\IndexInfoIterator`` + + The :phpmethod:`MongoDB\Client::listDatabases()`, + :phpmethod:`MongoDB\Database::listCollections()`, and + :phpmethod:`MongoDB\Collection::listIndexes()` methods return a + general traversable ``Iterator`` instance that contains the corresponding + results. + .. _php-lib-version-1.20: What's New in 1.20 From 41bafd158c0297e565382966422e034956ef8610 Mon Sep 17 00:00:00 2001 From: rustagir Date: Tue, 22 Oct 2024 13:44:53 -0400 Subject: [PATCH 2/3] remove double slashes --- source/whats-new.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/whats-new.txt b/source/whats-new.txt index 89fedab5..d55a9bc7 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -43,10 +43,10 @@ What's New in 2.0 - The following methods return ``void`` instead of the raw command response: - - ``MongoDB\\Client``: ``dropDatabase()`` - - ``MongoDB\\Collection``: ``drop()``, ``dropIndex()``, + - ``MongoDB\Client``: ``dropDatabase()`` + - ``MongoDB\Collection``: ``drop()``, ``dropIndex()``, ``dropIndexes()``, ``dropSearchIndex()``, ``rename()`` - - ``MongoDB\\Database``: ``createCollection()``, ``drop()``, + - ``MongoDB\Database``: ``createCollection()``, ``drop()``, ``dropCollection()``, ``renameCollection()`` To learn more about breaking changes in this release, see the @@ -82,13 +82,13 @@ improvements, and fixes: - Removes the deprecated ``IndexInfo::isGeoHaystack()`` method. - Removes the deprecated ``autoIndexId`` option for the - ``MongoDB\\Database::createCollection()`` method. + ``MongoDB\Database::createCollection()`` method. - Drops support for map-reduce functionality by removing the following deprecated methods and types: - - ``MongoDB\\Collection::mapReduce()`` - - ``MongoDB\\MapReduceResult`` + - ``MongoDB\Collection::mapReduce()`` + - ``MongoDB\MapReduceResult`` You can rewrite map-reduce operations by using aggregation pipeline stages such as ``$group`` and ``$merge``. To learn more, see @@ -98,9 +98,9 @@ improvements, and fixes: - Removes the following ``Iterator`` implementations: - - ``MongoDB\\Model\\CollectionInfoIterator`` - - ``MongoDB\\Model\\DatabaseInfoIterator`` - - ``MongoDB\\Model\\IndexInfoIterator`` + - ``MongoDB\Model\CollectionInfoIterator`` + - ``MongoDB\Model\DatabaseInfoIterator`` + - ``MongoDB\Model\IndexInfoIterator`` The :phpmethod:`MongoDB\Client::listDatabases()`, :phpmethod:`MongoDB\Database::listCollections()`, and From 73bd978cbbac9e3222e9c491c253623b986e40ae Mon Sep 17 00:00:00 2001 From: rustagir Date: Tue, 22 Oct 2024 15:35:42 -0400 Subject: [PATCH 3/3] small fixes - NR PR comments --- source/reference/class/MongoDBModelCollectionInfo.txt | 2 +- source/reference/class/MongoDBModelDatabaseInfo.txt | 2 +- source/reference/class/MongoDBModelIndexInfo.txt | 2 +- source/reference/method/MongoDBClient-listDatabaseNames.txt | 4 ++-- source/reference/method/MongoDBClient-listDatabases.txt | 2 +- source/reference/method/MongoDBCollection-listIndexes.txt | 2 +- .../reference/method/MongoDBDatabase-listCollectionNames.txt | 4 ++-- source/reference/method/MongoDBDatabase-listCollections.txt | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/source/reference/class/MongoDBModelCollectionInfo.txt b/source/reference/class/MongoDBModelCollectionInfo.txt index f4ada568..780231cf 100644 --- a/source/reference/class/MongoDBModelCollectionInfo.txt +++ b/source/reference/class/MongoDBModelCollectionInfo.txt @@ -8,7 +8,7 @@ Definition .. phpclass:: MongoDB\Model\CollectionInfo This class models information about a collection. Instances of this class are - returned in an `Iterator <{+php-manual}/class.iterator.php>`__ + stored in an :php:`Iterator ` returned by :phpmethod:`MongoDB\Database::listCollections()`. .. versionchanged:: 1.4 diff --git a/source/reference/class/MongoDBModelDatabaseInfo.txt b/source/reference/class/MongoDBModelDatabaseInfo.txt index 1a5aff7d..76268dd0 100644 --- a/source/reference/class/MongoDBModelDatabaseInfo.txt +++ b/source/reference/class/MongoDBModelDatabaseInfo.txt @@ -8,7 +8,7 @@ Definition .. phpclass:: MongoDB\Model\DatabaseInfo This class models information about a database. Instances of this class are - returned in an `Iterator <{+php-manual}/class.iterator.php>`__ + stored in an :php:`Iterator ` returned by :phpmethod:`MongoDB\Client::listDatabases()`. .. versionchanged:: 1.4 diff --git a/source/reference/class/MongoDBModelIndexInfo.txt b/source/reference/class/MongoDBModelIndexInfo.txt index 09805f50..14f69312 100644 --- a/source/reference/class/MongoDBModelIndexInfo.txt +++ b/source/reference/class/MongoDBModelIndexInfo.txt @@ -8,7 +8,7 @@ Definition .. phpclass:: MongoDB\Model\IndexInfo This class models information about an index. Instances of this class are - returned in an `Iterator <{+php-manual}/class.iterator.php>`__ + stored in an :php:`Iterator ` returned by :phpmethod:`MongoDB\Collection::listIndexes()`. This class implements PHP's :php:`ArrayAccess ` interface. This diff --git a/source/reference/method/MongoDBClient-listDatabaseNames.txt b/source/reference/method/MongoDBClient-listDatabaseNames.txt index bdb7e095..7a3baad6 100644 --- a/source/reference/method/MongoDBClient-listDatabaseNames.txt +++ b/source/reference/method/MongoDBClient-listDatabaseNames.txt @@ -77,8 +77,8 @@ Parameters Return Values ------------- -An :php:`Iterator `, which provides the name of each -database on the server. +An :php:`Iterator `, which provides the +name of each database on the server. Errors/Exceptions ----------------- diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt index 103fc39e..2fa477ec 100644 --- a/source/reference/method/MongoDBClient-listDatabases.txt +++ b/source/reference/method/MongoDBClient-listDatabases.txt @@ -75,7 +75,7 @@ Parameters Return Values ------------- -An `Iterator <{+php-manual}/class.iterator.php>`__ +An :php:`Iterator ` instance, which contains a :phpclass:`MongoDB\Model\DatabaseInfo` object for each database on the server. diff --git a/source/reference/method/MongoDBCollection-listIndexes.txt b/source/reference/method/MongoDBCollection-listIndexes.txt index e3357f58..f463e518 100644 --- a/source/reference/method/MongoDBCollection-listIndexes.txt +++ b/source/reference/method/MongoDBCollection-listIndexes.txt @@ -54,7 +54,7 @@ Parameters Return Values ------------- -An `Iterator <{+php-manual}/class.iterator.php>`__ +An :php:`Iterator ` instance, which contains a :phpclass:`MongoDB\Model\IndexInfo` object for each index for the collection. diff --git a/source/reference/method/MongoDBDatabase-listCollectionNames.txt b/source/reference/method/MongoDBDatabase-listCollectionNames.txt index d094028d..6ae0a3af 100644 --- a/source/reference/method/MongoDBDatabase-listCollectionNames.txt +++ b/source/reference/method/MongoDBDatabase-listCollectionNames.txt @@ -74,8 +74,8 @@ Parameters Return Values ------------- -An :php:`Iterator `, which provides the name of each -collection in the database. +An :php:`Iterator `, which provides the +name of each collection in the database. Example ------- diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt index b6ee27c4..5c796145 100644 --- a/source/reference/method/MongoDBDatabase-listCollections.txt +++ b/source/reference/method/MongoDBDatabase-listCollections.txt @@ -72,7 +72,7 @@ Parameters Return Values ------------- -An `Iterator <{+php-manual}/class.iterator.php>`__ +An :php:`Iterator ` instance, which contains a :phpclass:`MongoDB\Model\CollectionInfo` object for each collection in the database.