Skip to content

DOCSP-43953: v2 iterator changes #172

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

Merged
merged 4 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions source/reference/class/MongoDBModelCollectionInfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()`.
stored in an :php:`Iterator <manual/en/class.iterator.php>`
returned by :phpmethod:`MongoDB\Database::listCollections()`.

.. versionchanged:: 1.4

Expand Down
20 changes: 0 additions & 20 deletions source/reference/class/MongoDBModelCollectionInfoIterator.txt

This file was deleted.

4 changes: 2 additions & 2 deletions source/reference/class/MongoDBModelDatabaseInfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()`.
stored in an :php:`Iterator <manual/en/class.iterator.php>`
returned by :phpmethod:`MongoDB\Client::listDatabases()`.

.. versionchanged:: 1.4

Expand Down
20 changes: 0 additions & 20 deletions source/reference/class/MongoDBModelDatabaseInfoIterator.txt

This file was deleted.

4 changes: 2 additions & 2 deletions source/reference/class/MongoDBModelIndexInfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()`.
stored in an :php:`Iterator <manual/en/class.iterator.php>`
returned by :phpmethod:`MongoDB\Collection::listIndexes()`.

This class implements PHP's :php:`ArrayAccess <arrayaccess>` interface. This
provides a mechanism for accessing index fields for which there exists no
Expand Down
20 changes: 0 additions & 20 deletions source/reference/class/MongoDBModelIndexInfoIterator.txt

This file was deleted.

4 changes: 2 additions & 2 deletions source/reference/method/MongoDBClient-listDatabaseNames.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ Parameters
Return Values
-------------

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

Errors/Exceptions
-----------------
Expand Down
10 changes: 4 additions & 6 deletions source/reference/method/MongoDBClient-listDatabases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
MongoDB\\Client::listDatabases()
================================

.. default-domain:: mongodb

.. contents:: On this page
:local:
:backlinks: none
Expand All @@ -19,7 +17,7 @@ Definition

.. code-block:: php

function listDatabases(array $options = []): MongoDB\Model\DatabaseInfoIterator
function listDatabases(array $options = []): Iterator

Parameters
----------
Expand Down Expand Up @@ -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 :php:`Iterator <manual/en/class.iterator.php>`
instance, which contains a :phpclass:`MongoDB\Model\DatabaseInfo` object
for each database on the server.

Errors/Exceptions
-----------------
Expand Down
9 changes: 4 additions & 5 deletions source/reference/method/MongoDBCollection-listIndexes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
MongoDB\\Collection::listIndexes()
==================================

.. default-domain:: mongodb

.. contents:: On this page
:local:
:backlinks: none
Expand All @@ -19,7 +17,7 @@ Definition

.. code-block:: php

function listIndexes(array $options = []): MongoDB\Model\IndexInfoIterator
function listIndexes(array $options = []): Iterator

Parameters
----------
Expand Down Expand Up @@ -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 :php:`Iterator <manual/en/class.iterator.php>`
instance, which contains a :phpclass:`MongoDB\Model\IndexInfo` object
for each index for the collection.

Errors/Exceptions
-----------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ Parameters
Return Values
-------------

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

Example
-------
Expand Down
10 changes: 4 additions & 6 deletions source/reference/method/MongoDBDatabase-listCollections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
MongoDB\\Database::listCollections()
====================================

.. default-domain:: mongodb

.. contents:: On this page
:local:
:backlinks: none
Expand All @@ -19,7 +17,7 @@ Definition

.. code-block:: php

function listCollections(array $options = []): MongoDB\Model\CollectionInfoIterator
function listCollections(array $options = []): Iterator

Parameters
----------
Expand Down Expand Up @@ -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 :php:`Iterator <manual/en/class.iterator.php>`
instance, which contains a :phpclass:`MongoDB\Model\CollectionInfo`
object for each collection in the database.

Example
-------
Expand Down
3 changes: 0 additions & 3 deletions source/reference/result-classes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ Result Classes
UpdateResult Class </reference/class/MongoDBUpdateResult>
ChangeStream Class </reference/class/MongoDBChangeStream>
CollectionInfo Class </reference/class/MongoDBModelCollectionInfo>
CollectionInfoIterator Class </reference/class/MongoDBModelCollectionInfoIterator>
DatabaseInfo Class </reference/class/MongoDBModelDatabaseInfo>
DatabaseInfoIterator Class </reference/class/MongoDBModelDatabaseInfoIterator>
IndexInfo Class </reference/class/MongoDBModelIndexInfo>
IndexInfoIterator Class </reference/class/MongoDBModelIndexInfoIterator>
26 changes: 19 additions & 7 deletions source/whats-new.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ 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
Expand Down Expand Up @@ -82,20 +82,32 @@ improvements, and fixes:
- Removes the deprecated ``IndexInfo::isGeoHaystack()`` method.

- Removes the deprecated ``autoIndexId`` and ``flags`` options 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
:manual:`Map-Reduce to Aggregation Pipeline
</reference/map-reduce-to-aggregation-pipeline/>` 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
Expand Down
Loading