Unverified Commit a9cf06b9 authored by Jeremy Mikola's avatar Jeremy Mikola Committed by GitHub

Revise group() and mapReduce() info in upgrade guide

parent d56f01d4
...@@ -109,8 +109,7 @@ Old and New Methods ...@@ -109,8 +109,7 @@ Old and New Methods
- Not implemented. - Not implemented.
* - :php:`MongoCollection::group() <mongocollection.group>` * - :php:`MongoCollection::group() <mongocollection.group>`
- Not yet implemented. See :issue:`PHPLIB-177`. - Not implemented. Use :phpmethod:`MongoDB\\Database::command()`.
Use :phpmethod:`MongoDB\\Database::command()`.
* - :php:`MongoCollection::insert() <mongocollection.insert>` * - :php:`MongoCollection::insert() <mongocollection.insert>`
- :phpmethod:`MongoDB\\Collection::insertOne()` - :phpmethod:`MongoDB\\Collection::insertOne()`
...@@ -156,10 +155,10 @@ also split to distinguish between :manual:`updating specific fields ...@@ -156,10 +155,10 @@ also split to distinguish between :manual:`updating specific fields
Group Command Helper Group Command Helper
-------------------- --------------------
:phpclass:`MongoDB\\Collection` does not yet have a helper method for the :phpclass:`MongoDB\\Collection` does have a helper method for the
:manual:`group </reference/command/group>` command; however, it is planned in :manual:`group </reference/command/group>` command; The following example
:issue:`PHPLIB-177`. The following example demonstrates how to execute a group demonstrates how to execute a group command using the
command using the :phpmethod:`MongoDB\\Database::command()` method: :phpmethod:`MongoDB\\Database::command()` method:
.. code-block:: php .. code-block:: php
...@@ -177,28 +176,6 @@ command using the :phpmethod:`MongoDB\\Database::command()` method: ...@@ -177,28 +176,6 @@ command using the :phpmethod:`MongoDB\\Database::command()` method:
$resultDocument = $cursor->toArray()[0]; $resultDocument = $cursor->toArray()[0];
MapReduce Command Helper
------------------------
:phpclass:`MongoDB\\Collection` does not yet have a helper method for the
:manual:`mapReduce </reference/command/mapReduce>` command; however, that is
planned in :issue:`PHPLIB-53`. The following example demonstrates how to execute
a mapReduce command using the :phpmethod:`MongoDB\\Database::command()` method:
.. code-block:: php
<?php
$database = (new MongoDB\Client)->selectDatabase('db_name');
$cursor = $database->command([
'mapReduce' => 'collection_name',
'map' => new MongoDB\BSON\Javascript('...'),
'reduce' => new MongoDB\BSON\Javascript('...'),
'out' => 'output_collection_name',
]);
$resultDocument = $cursor->toArray()[0];
DBRef Helpers DBRef Helpers
------------- -------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment