Skip to content

Commit 6a2ab7a

Browse files
committed
JT PR fixes 1
1 parent e634bc8 commit 6a2ab7a

15 files changed

+285
-244
lines changed

source/includes/write/bulk-write.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
$bulkWrite = MongoDB\ClientBulkWrite::createWithCollection($restaurantCollection);
6262
$bulkWrite->insertOne(['name' => 'Mongo Deli', 'cuisine' => 'Sandwiches']);
6363

64-
$bulkWrite = MongoDB\ClientBulkWrite::withCollection($movieCollection);
64+
$bulkWrite = $bulkWrite->withCollection($movieCollection);
6565
$bulkWrite->insertOne(['title' => 'The Green Ray', 'year' => 1986]);
6666
// end-bulk-client-insert-one
6767

@@ -126,7 +126,7 @@
126126
['upsert' => true],
127127
);
128128

129-
$bulkWrite = MongoDB\ClientBulkWrite::withCollection($movieCollection);
129+
$bulkWrite = $bulkWrite->withCollection($movieCollection);
130130
$bulkWrite->insertOne(['title' => 'The Green Ray', 'year' => 1986]);
131131
$bulkWrite->deleteMany(
132132
['title' => ['$regex' => 'd{2,}']],

source/reference/class/MongoDBBulkWriteCommandResult.txt

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,24 @@ Methods
2121
- Description
2222

2323
* - ``getInsertedCount()``
24-
- | Returns the number of documents inserted, if any.
24+
- | Returns the total number of documents inserted by all
25+
insert operations in the bulk write command.
2526

2627
* - ``getMatchedCount()``
27-
- | Returns the number of documents matched during update and replace
28-
operations, if applicable.
28+
- | Returns the total number of documents matched by all
29+
update and replace operations in the bulk write command.
2930

3031
* - ``getModifiedCount()``
31-
- | Returns the number of documents modified, if any.
32+
- | Returns the total number of documents modified by all update
33+
and replace operations in the bulk write command.
3234

3335
* - ``getUpsertedCount()``
34-
- | Returns the number of documents upserted, if any.
36+
- | Returns the total number of documents upserted by all update
37+
and replace operations in the bulk write command.
3538

3639
* - ``getDeletedCount()``
37-
- | Returns the number of documents deleted, if any.
40+
- | Return the total number of documents deleted by all delete
41+
operations in the bulk write command.
3842

3943
* - ``getInsertResults()``
4044
- | Returns a map of results of each successful insert operation. Each
@@ -53,9 +57,10 @@ Methods
5357
a document with information corresponding to the operation.
5458

5559
* - ``isAcknowledged()``
56-
- | Returns a boolean indicating whether the bulk operation was acknowledged.
60+
- | Returns a boolean indicating whether the bulk operation was
61+
acknowledged by the server.
5762

5863
See Also
5964
--------
6065

61-
- :ref:`php-bulk-write`
66+
- :ref:`php-client-bulk-write` section of the Bulk Write Operations guide

source/reference/class/MongoDBClientBulkWrite.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@ Definition
99

1010
.. phpclass:: MongoDB\ClientBulkWrite
1111

12-
This class allows you to assemble a bulk write command to pass to
13-
:phpmethod:`MongoDB\Client::bulkWrite()`.
12+
This class enables you to assemble a bulk write command to pass to
13+
:phpmethod:`MongoDB\Client::bulkWrite()` to perform write operations
14+
across multiple namespaces.
1415

15-
This class allows you to specify write operations across multiple
16-
namespaces in the same cluster.
16+
This class is a builder to instantiate a :php:`BulkWriteCommand
17+
<mongodb-driver-bulkwritecommand>` instance that the library sends to the
18+
server.
19+
20+
Specify the ``writeConcern`` option as a top-level option to
21+
:phpmethod:`MongoDB\Client::bulkWrite()` instead of in each
22+
individual operation on this class.
1723

1824
Methods
1925
-------
@@ -42,4 +48,4 @@ Methods
4248
See Also
4349
--------
4450

45-
- :ref:`php-bulk-write`
51+
- :ref:`php-client-bulk-write` section of the Bulk Write Operations guide

source/reference/method/MongoDBClient-bulkWrite.txt

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Definition
1818

1919
.. phpmethod:: MongoDB\Client::bulkWrite()
2020

21-
Executes multiple write operations across multiple namespaces.
21+
Perform multiple write operations across multiple namespaces.
2222

2323
.. code-block:: php
2424

@@ -30,21 +30,20 @@ Definition
3030
Parameters
3131
----------
3232

33-
``$bulk`` : :phpclass:`MongoDB\ClientBulkWrite` or ``BulkWriteCommand``
34-
(reserve for use with the {+extension-short+} only)
33+
``$bulk`` : :phpclass:`MongoDB\ClientBulkWrite` or
34+
:php:`BulkWriteCommand <mongodb-driver-bulkwritecommand>`
35+
36+
.. tip:: Prefer ClientBulkWrite API
37+
38+
We recommend using the ``ClientBulkWrite`` builder class and
39+
methods to specify write operations in a bulk write command instead
40+
of using the ``BulkWriteCommand`` class.
3541

3642
Represents the assembled bulk write command or builder.
3743
:phpmethod:`MongoDB\Client::bulkWrite()` supports
38-
:phpmethod:`MongoDB\Collection::deleteMany()`,
39-
:phpmethod:`MongoDB\Collection::deleteOne()`,
40-
:phpmethod:`MongoDB\Collection::insertOne()`,
41-
:phpmethod:`MongoDB\Collection::replaceOne()`,
42-
:phpmethod:`MongoDB\Collection::updateMany()`, and
43-
:phpmethod:`MongoDB\Collection::updateOne()` operations.
44-
45-
The ``writeConcern`` option is specified as a top-level option to
46-
:phpmethod:`MongoDB\Client::bulkWrite()` instead of each individual
47-
operation.
44+
``deleteMany``, ``deleteOne()``, ``insertOne()``,
45+
``replaceOne()``, ``updateMany()``, and ``updateOne()``
46+
operations.
4847

4948
``$options`` : array
5049
An array specifying the desired options.
@@ -89,7 +88,7 @@ Behavior
8988
See Also
9089
--------
9190

92-
- :ref:`php-bulk-write`
91+
- :ref:`php-client-bulk-write` section of the Bulk Write Operations guide
9392
- :ref:`php-write`
9493
- :phpmethod:`MongoDB\Collection::deleteMany()`
9594
- :phpmethod:`MongoDB\Collection::deleteOne()`

source/reference/method/MongoDBClientBulkWrite-createWithCollection.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Definition
1515

1616
.. phpmethod:: MongoDB\ClientBulkWrite::createWithCollection()
1717

18-
Creates an instance of :phpclass:`MongoDB\ClientBulkWrite` from the provided
18+
Create an instance of :phpclass:`MongoDB\ClientBulkWrite` from the provided
1919
:phpclass:`MongoDB\Collection` instance.
2020

2121
.. code-block:: php
@@ -82,4 +82,4 @@ Errors/Exceptions
8282
See Also
8383
--------
8484

85-
- :ref:`php-bulk-write`
85+
- :ref:`php-client-bulk-write` section of the Bulk Write Operations guide

source/reference/method/MongoDBClientBulkWrite-deleteMany.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Definition
1515

1616
.. phpmethod:: MongoDB\ClientBulkWrite::deleteMany()
1717

18-
Specifies a delete operation in the bulk write command for all
18+
Specify a delete operation in the bulk write command for all
1919
matching documents. This method returns the
2020
:phpclass:`MongoDB\ClientBulkWrite` instance on which its called.
2121

@@ -70,4 +70,4 @@ Behavior
7070
See Also
7171
--------
7272

73-
- :ref:`php-bulk-write`
73+
- :ref:`php-client-bulk-write` section of the Bulk Write Operations guide

source/reference/method/MongoDBClientBulkWrite-deleteOne.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Definition
1515

1616
.. phpmethod:: MongoDB\ClientBulkWrite::deleteOne()
1717

18-
Specifies a delete operation in the bulk write command for the first
18+
Specify a delete operation in the bulk write command for the first
1919
matching document. This method returns the
2020
:phpclass:`MongoDB\ClientBulkWrite` instance on which its called.
2121

@@ -70,4 +70,4 @@ Behavior
7070
See Also
7171
--------
7272

73-
- :ref:`php-bulk-write`
73+
- :ref:`php-client-bulk-write` section of the Bulk Write Operations guide

source/reference/method/MongoDBClientBulkWrite-insertOne.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Definition
1515

1616
.. phpmethod:: MongoDB\ClientBulkWrite::insertOne()
1717

18-
Specifies an insert operation in the bulk write command. This method
18+
Specify an insert operation in the bulk write command. This method
1919
returns the :phpclass:`MongoDB\ClientBulkWrite` instance on which its called.
2020

2121
.. code-block:: php
@@ -50,4 +50,4 @@ Behavior
5050
See Also
5151
--------
5252

53-
- :ref:`php-bulk-write`
53+
- :ref:`php-client-bulk-write` section of the Bulk Write Operations guide

source/reference/method/MongoDBClientBulkWrite-replaceOne.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Definition
1515

1616
.. phpmethod:: MongoDB\ClientBulkWrite::replaceOne()
1717

18-
Specifies a replace operation in the bulk write command for the first
18+
Specify a replace operation in the bulk write command for the first
1919
matching document. This method returns the
2020
:phpclass:`MongoDB\ClientBulkWrite` instance on which its called.
2121

@@ -86,4 +86,4 @@ Behavior
8686
See Also
8787
--------
8888

89-
- :ref:`php-bulk-write`
89+
- :ref:`php-client-bulk-write` section of the Bulk Write Operations guide

source/reference/method/MongoDBClientBulkWrite-updateMany.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Definition
1515

1616
.. phpmethod:: MongoDB\ClientBulkWrite::updateMany()
1717

18-
Specifies an update operation in the bulk write command for all
18+
Specify an update operation in the bulk write command for all
1919
matching documents. This method returns the
2020
:phpclass:`MongoDB\ClientBulkWrite` instance on which its called.
2121

@@ -93,4 +93,4 @@ Behavior
9393
See Also
9494
--------
9595

96-
- :ref:`php-bulk-write`
96+
- :ref:`php-client-bulk-write` section of the Bulk Write Operations guide

source/reference/method/MongoDBClientBulkWrite-updateOne.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Definition
1515

1616
.. phpmethod:: MongoDB\ClientBulkWrite::updateOne()
1717

18-
Specifies an update operation in the bulk write command for the first
18+
Specify an update operation in the bulk write command for the first
1919
matching document. This method returns the
2020
:phpclass:`MongoDB\ClientBulkWrite` instance on which its called.
2121

@@ -95,4 +95,4 @@ Behavior
9595
See Also
9696
--------
9797

98-
- :ref:`php-bulk-write`
98+
- :ref:`php-client-bulk-write` section of the Bulk Write Operations guide

source/reference/method/MongoDBClientBulkWrite-withCollection.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ Definition
1515

1616
.. phpmethod:: MongoDB\ClientBulkWrite::withCollection()
1717

18-
Creates an instance of :phpclass:`MongoDB\ClientBulkWrite` from the provided
18+
Return an instance of :phpclass:`MongoDB\ClientBulkWrite` from the provided
1919
:phpclass:`MongoDB\Collection` instance. This method allows you to
2020
add subsequent write operations on a different collection than that
21-
which the ``MongoDB\ClientBulkWrite`` was created with.
21+
with which the ``MongoDB\ClientBulkWrite`` was created with.
2222

2323
.. code-block:: php
2424

@@ -28,14 +28,16 @@ Definition
2828

2929

3030
You cannot mix ``Collection`` instances associated with different
31-
``Manager`` objects.
31+
``Manager`` objects because the library sends the client bulk
32+
write operation as a command to a single server.
3233

3334
Parameters
3435
----------
3536

3637
``$collection`` : :phpclass:`MongoDB\Collection`
37-
The ``Collection`` instance to set as the target for bulk write
38-
operations.
38+
The ``Collection`` instance to set as the target for write operations
39+
added to the ``ClientBulkWrite`` instance after calling
40+
``withCollection()``.
3941

4042
Errors/Exceptions
4143
-----------------
@@ -47,4 +49,4 @@ Errors/Exceptions
4749
See Also
4850
--------
4951

50-
- :ref:`php-bulk-write`
52+
- :ref:`php-client-bulk-write` section of the Bulk Write Operations guide

source/reference/method/MongoDBCollection-bulkWrite.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Behavior
147147
See Also
148148
--------
149149

150-
- :ref:`php-bulk-write`
150+
- :ref:`php-coll-bulk-write` section of the Bulk Write Operations guide
151151
- :ref:`php-write`
152152
- :phpmethod:`MongoDB\Collection::deleteMany()`
153153
- :phpmethod:`MongoDB\Collection::deleteOne()`

source/whats-new.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,27 @@ What's New
2020
Learn about new features, improvements, and fixes introduced in the
2121
following versions of the {+php-library+}:
2222

23+
* :ref:`Version 2.1 <php-lib-version-2.1>`
2324
* :ref:`Version 2.0 <php-lib-version-2.0>`
2425
* :ref:`Version 1.21 <php-lib-version-1.21>`
2526
* :ref:`Version 1.20 <php-lib-version-1.20>`
2627
* :ref:`Version 1.19 <php-lib-version-1.19>`
2728
* :ref:`Version 1.18 <php-lib-version-1.18>`
2829
* :ref:`Version 1.17 <php-lib-version-1.17>`
2930

31+
.. _php-lib-version-2.1:
32+
33+
What's New in 2.1
34+
-----------------
35+
36+
The {+library-short+} v2.1 release includes the following features,
37+
improvements, and fixes:
38+
39+
- Implements a *client* bulk write API that allows you to perform write
40+
operations on multiple databases and collections in the same call. To learn
41+
more about this feature, see the :ref:`php-client-bulk-write`
42+
section of the Bulk Write Operations guide.
43+
3044
.. _php-lib-version-2.0:
3145

3246
What's New in 2.0

0 commit comments

Comments
 (0)