Skip to content

Commit 4205c7c

Browse files
authored
Merge pull request #172 from rustagir/DOCSP-43953-v2-iterator-changes
DOCSP-43953: v2 iterator changes
2 parents dc9f6c2 + af4e400 commit 4205c7c

13 files changed

+41
-97
lines changed

source/reference/class/MongoDBModelCollectionInfo.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Definition
88
.. phpclass:: MongoDB\Model\CollectionInfo
99

1010
This class models information about a collection. Instances of this class are
11-
returned by traversing a :phpclass:`MongoDB\Model\CollectionInfoIterator`,
12-
which is returned by :phpmethod:`MongoDB\Database::listCollections()`.
11+
stored in an :php:`Iterator <manual/en/class.iterator.php>`
12+
returned by :phpmethod:`MongoDB\Database::listCollections()`.
1313

1414
.. versionchanged:: 1.4
1515

source/reference/class/MongoDBModelCollectionInfoIterator.txt

Lines changed: 0 additions & 20 deletions
This file was deleted.

source/reference/class/MongoDBModelDatabaseInfo.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Definition
88
.. phpclass:: MongoDB\Model\DatabaseInfo
99

1010
This class models information about a database. Instances of this class are
11-
returned by traversing a :phpclass:`MongoDB\Model\DatabaseInfoIterator`,
12-
which is returned by :phpmethod:`MongoDB\Client::listDatabases()`.
11+
stored in an :php:`Iterator <manual/en/class.iterator.php>`
12+
returned by :phpmethod:`MongoDB\Client::listDatabases()`.
1313

1414
.. versionchanged:: 1.4
1515

source/reference/class/MongoDBModelDatabaseInfoIterator.txt

Lines changed: 0 additions & 20 deletions
This file was deleted.

source/reference/class/MongoDBModelIndexInfo.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Definition
88
.. phpclass:: MongoDB\Model\IndexInfo
99

1010
This class models information about an index. Instances of this class are
11-
returned by traversing a :phpclass:`MongoDB\Model\IndexInfoIterator`,
12-
which is returned by :phpmethod:`MongoDB\Collection::listIndexes()`.
11+
stored in an :php:`Iterator <manual/en/class.iterator.php>`
12+
returned by :phpmethod:`MongoDB\Collection::listIndexes()`.
1313

1414
This class implements PHP's :php:`ArrayAccess <arrayaccess>` interface. This
1515
provides a mechanism for accessing index fields for which there exists no

source/reference/class/MongoDBModelIndexInfoIterator.txt

Lines changed: 0 additions & 20 deletions
This file was deleted.

source/reference/method/MongoDBClient-listDatabaseNames.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ Parameters
7777
Return Values
7878
-------------
7979

80-
An :php:`Iterator <class.iterator.php>`, which provides the name of each
81-
database on the server.
80+
An :php:`Iterator <manual/en/class.iterator.php>`, which provides the
81+
name of each database on the server.
8282

8383
Errors/Exceptions
8484
-----------------

source/reference/method/MongoDBClient-listDatabases.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
MongoDB\\Client::listDatabases()
33
================================
44

5-
.. default-domain:: mongodb
6-
75
.. contents:: On this page
86
:local:
97
:backlinks: none
@@ -19,7 +17,7 @@ Definition
1917

2018
.. code-block:: php
2119

22-
function listDatabases(array $options = []): MongoDB\Model\DatabaseInfoIterator
20+
function listDatabases(array $options = []): Iterator
2321

2422
Parameters
2523
----------
@@ -77,9 +75,9 @@ Parameters
7775
Return Values
7876
-------------
7977

80-
A traversable :phpclass:`MongoDB\Model\DatabaseInfoIterator`, which contains
81-
a :phpclass:`MongoDB\Model\DatabaseInfo` object for each database on the
82-
server.
78+
An :php:`Iterator <manual/en/class.iterator.php>`
79+
instance, which contains a :phpclass:`MongoDB\Model\DatabaseInfo` object
80+
for each database on the server.
8381

8482
Errors/Exceptions
8583
-----------------

source/reference/method/MongoDBCollection-listIndexes.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
MongoDB\\Collection::listIndexes()
33
==================================
44

5-
.. default-domain:: mongodb
6-
75
.. contents:: On this page
86
:local:
97
:backlinks: none
@@ -19,7 +17,7 @@ Definition
1917

2018
.. code-block:: php
2119

22-
function listIndexes(array $options = []): MongoDB\Model\IndexInfoIterator
20+
function listIndexes(array $options = []): Iterator
2321

2422
Parameters
2523
----------
@@ -56,8 +54,9 @@ Parameters
5654
Return Values
5755
-------------
5856

59-
A traversable :phpclass:`MongoDB\Model\IndexInfoIterator`, which contains a
60-
:phpclass:`MongoDB\Model\IndexInfo` object for each index for the collection.
57+
An :php:`Iterator <manual/en/class.iterator.php>`
58+
instance, which contains a :phpclass:`MongoDB\Model\IndexInfo` object
59+
for each index for the collection.
6160

6261
Errors/Exceptions
6362
-----------------

source/reference/method/MongoDBDatabase-listCollectionNames.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ Parameters
7474
Return Values
7575
-------------
7676

77-
An :php:`Iterator <class.iterator.php>`, which provides the name of each
78-
collection in the database.
77+
An :php:`Iterator <manual/en/class.iterator.php>`, which provides the
78+
name of each collection in the database.
7979

8080
Example
8181
-------

source/reference/method/MongoDBDatabase-listCollections.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
MongoDB\\Database::listCollections()
33
====================================
44

5-
.. default-domain:: mongodb
6-
75
.. contents:: On this page
86
:local:
97
:backlinks: none
@@ -19,7 +17,7 @@ Definition
1917

2018
.. code-block:: php
2119

22-
function listCollections(array $options = []): MongoDB\Model\CollectionInfoIterator
20+
function listCollections(array $options = []): Iterator
2321

2422
Parameters
2523
----------
@@ -74,9 +72,9 @@ Parameters
7472
Return Values
7573
-------------
7674

77-
A traversable :phpclass:`MongoDB\Model\CollectionInfoIterator`, which contains
78-
a :phpclass:`MongoDB\Model\CollectionInfo` object for each collection in the
79-
database.
75+
An :php:`Iterator <manual/en/class.iterator.php>`
76+
instance, which contains a :phpclass:`MongoDB\Model\CollectionInfo`
77+
object for each collection in the database.
8078

8179
Example
8280
-------

source/reference/result-classes.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,5 @@ Result Classes
1212
UpdateResult Class </reference/class/MongoDBUpdateResult>
1313
ChangeStream Class </reference/class/MongoDBChangeStream>
1414
CollectionInfo Class </reference/class/MongoDBModelCollectionInfo>
15-
CollectionInfoIterator Class </reference/class/MongoDBModelCollectionInfoIterator>
1615
DatabaseInfo Class </reference/class/MongoDBModelDatabaseInfo>
17-
DatabaseInfoIterator Class </reference/class/MongoDBModelDatabaseInfoIterator>
1816
IndexInfo Class </reference/class/MongoDBModelIndexInfo>
19-
IndexInfoIterator Class </reference/class/MongoDBModelIndexInfoIterator>

source/whats-new.txt

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ What's New in 2.0
4242

4343
- The following methods return ``void`` instead of the raw command
4444
response:
45-
46-
- ``MongoDB\\Client``: ``dropDatabase()``
47-
- ``MongoDB\\Collection``: ``drop()``, ``dropIndex()``,
45+
46+
- ``MongoDB\Client``: ``dropDatabase()``
47+
- ``MongoDB\Collection``: ``drop()``, ``dropIndex()``,
4848
``dropIndexes()``, ``dropSearchIndex()``, ``rename()``
49-
- ``MongoDB\\Database``: ``createCollection()``, ``drop()``,
49+
- ``MongoDB\Database``: ``createCollection()``, ``drop()``,
5050
``dropCollection()``, ``renameCollection()``
5151

5252
To learn more about breaking changes in this release, see the
@@ -82,20 +82,32 @@ improvements, and fixes:
8282
- Removes the deprecated ``IndexInfo::isGeoHaystack()`` method.
8383

8484
- Removes the deprecated ``autoIndexId`` and ``flags`` options for the
85-
``MongoDB\\Database::createCollection()`` method.
85+
``MongoDB\Database::createCollection()`` method.
8686

8787
- Drops support for map-reduce functionality by removing the following
8888
deprecated methods and types:
8989

90-
- ``MongoDB\\Collection::mapReduce()``
91-
- ``MongoDB\\MapReduceResult``
90+
- ``MongoDB\Collection::mapReduce()``
91+
- ``MongoDB\MapReduceResult``
9292

9393
You can rewrite map-reduce operations by using aggregation pipeline
9494
stages such as ``$group`` and ``$merge``. To learn more, see
9595
:manual:`Map-Reduce to Aggregation Pipeline
9696
</reference/map-reduce-to-aggregation-pipeline/>` in the
9797
{+mdb-server+} manual.
9898

99+
- Removes the following ``Iterator`` implementations:
100+
101+
- ``MongoDB\Model\CollectionInfoIterator``
102+
- ``MongoDB\Model\DatabaseInfoIterator``
103+
- ``MongoDB\Model\IndexInfoIterator``
104+
105+
The :phpmethod:`MongoDB\Client::listDatabases()`,
106+
:phpmethod:`MongoDB\Database::listCollections()`, and
107+
:phpmethod:`MongoDB\Collection::listIndexes()` methods return a
108+
general traversable ``Iterator`` instance that contains the corresponding
109+
results.
110+
99111
.. _php-lib-version-1.20:
100112

101113
What's New in 1.20

0 commit comments

Comments
 (0)