-
Notifications
You must be signed in to change notification settings - Fork 34
DOCSP-49150: bulkWrite docs + api #250
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
rustagir
merged 13 commits into
mongodb:master
from
rustagir:DOCSP-49150-client-bulk-write
May 21, 2025
Merged
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
063a59b
DOCSP-49150: bulkWrite docs + api
rustagir e634bc8
first pass fixes
rustagir 6a2ab7a
JT PR fixes 1
rustagir 5cbb508
upgrade composer package vs
rustagir d14ca58
JT PR fixes 2
rustagir a29dfde
small fix
rustagir 6d3217e
JT PR fixes 3
rustagir 5b07d53
remove reference to writeconcern option
rustagir 5ae84b8
Merge branch 'master' into DOCSP-49150-client-bulk-write
rustagir 1b2d7e0
add return values sections
rustagir b4005d9
object -> instance
rustagir f25264d
NR PR fixes 1
rustagir 7166329
returns -> throws
rustagir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,71 @@ | ||||||||
===================================== | ||||||||
MongoDB\\BulkWriteCommandResult Class | ||||||||
===================================== | ||||||||
|
||||||||
Definition | ||||||||
---------- | ||||||||
|
||||||||
.. phpclass:: MongoDB\BulkWriteCommandResult | ||||||||
|
||||||||
This class contains information about an executed client bulk write operation. It | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. S: to avoid "execute":
Suggested change
|
||||||||
is returned from :phpmethod:`MongoDB\Client::bulkWrite()`. | ||||||||
|
||||||||
Methods | ||||||||
------- | ||||||||
|
||||||||
.. list-table:: | ||||||||
:widths: 30 70 | ||||||||
:header-rows: 1 | ||||||||
|
||||||||
* - Method | ||||||||
- Description | ||||||||
|
||||||||
* - ``getInsertedCount()`` | ||||||||
- | Returns the total number of documents inserted by all | ||||||||
insert operations in the bulk write command. | ||||||||
|
||||||||
* - ``getMatchedCount()`` | ||||||||
- | Returns the total number of documents matched by all | ||||||||
update and replace operations in the bulk write command. | ||||||||
|
||||||||
* - ``getModifiedCount()`` | ||||||||
- | Returns the total number of documents modified by all update | ||||||||
and replace operations in the bulk write command. | ||||||||
|
||||||||
* - ``getUpsertedCount()`` | ||||||||
- | Returns the total number of documents upserted by all update | ||||||||
and replace operations in the bulk write command. | ||||||||
|
||||||||
* - ``getDeletedCount()`` | ||||||||
- | Return the total number of documents deleted by all delete | ||||||||
operations in the bulk write command. | ||||||||
|
||||||||
* - ``getInsertResults()`` | ||||||||
- | Returns a map of results of each successful insert operation. Each | ||||||||
operation is represented by an integer key, which contains a | ||||||||
document with information corresponding to the operation such | ||||||||
as the inserted ``_id`` value. | ||||||||
|
||||||||
* - ``getUpdateResults()`` | ||||||||
- | Returns a map of results of each successful update operation. Each | ||||||||
operation is represented by an integer key, which contains a | ||||||||
document with information corresponding to the operation. | ||||||||
|
||||||||
* - ``getDeleteResults()`` | ||||||||
- | Returns a map of results of each successful delete operation. | ||||||||
Each operation is represented by an integer key, which contains | ||||||||
a document with information corresponding to the operation. | ||||||||
|
||||||||
* - ``isAcknowledged()`` | ||||||||
- | Returns a boolean indicating whether the bulk operation was | ||||||||
acknowledged by the server. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s: active voice
Suggested change
|
||||||||
|
||||||||
To learn more about the information returned from the server when you | ||||||||
perform a client bulk write operation, see the :manual:`Output | ||||||||
</reference/method/Mongo.bulkWrite/#output>` section of the | ||||||||
``Mongo.bulkWrite`` shell method reference. | ||||||||
|
||||||||
See Also | ||||||||
-------- | ||||||||
|
||||||||
- :ref:`php-client-bulk-write` section of the Bulk Write Operations guide |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
============================== | ||
MongoDB\\ClientBulkWrite Class | ||
============================== | ||
|
||
.. versionadded:: 2.1 | ||
|
||
Definition | ||
---------- | ||
|
||
.. phpclass:: MongoDB\ClientBulkWrite | ||
|
||
This class enables you to assemble a bulk write command that you | ||
pass to :phpmethod:`MongoDB\Client::bulkWrite()` to perform write | ||
operations across multiple namespaces. | ||
|
||
``ClientBulkWrite`` is a builder class to create a :php:`BulkWriteCommand | ||
<mongodb-driver-bulkwritecommand>` instance that the library sends to the | ||
server. | ||
|
||
Methods | ||
------- | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
|
||
createWithCollection() </reference/method/MongoDBClientBulkWrite-createWithCollection> | ||
deleteMany() </reference/method/MongoDBClientBulkWrite-deleteMany> | ||
deleteOne() </reference/method/MongoDBClientBulkWrite-deleteOne> | ||
insertOne() </reference/method/MongoDBClientBulkWrite-insertOne> | ||
replaceOne() </reference/method/MongoDBClientBulkWrite-replaceOne> | ||
updateMany() </reference/method/MongoDBClientBulkWrite-updateMany> | ||
updateOne() </reference/method/MongoDBClientBulkWrite-updateOne> | ||
withCollection() </reference/method/MongoDBClientBulkWrite-withCollection> | ||
|
||
- :phpmethod:`MongoDB\ClientBulkWrite::createWithCollection()` | ||
- :phpmethod:`MongoDB\ClientBulkWrite::deleteMany()` | ||
- :phpmethod:`MongoDB\ClientBulkWrite::deleteOne()` | ||
- :phpmethod:`MongoDB\ClientBulkWrite::insertOne()` | ||
- :phpmethod:`MongoDB\ClientBulkWrite::replaceOne()` | ||
- :phpmethod:`MongoDB\ClientBulkWrite::updateMany()` | ||
- :phpmethod:`MongoDB\ClientBulkWrite::updateOne()` | ||
- :phpmethod:`MongoDB\ClientBulkWrite::withCollection()` | ||
|
||
See Also | ||
-------- | ||
|
||
- :ref:`php-client-bulk-write` section of the Bulk Write Operations guide |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S: second person / present tense; although it seems like a lot of these use "users" so that change is not necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can change in all extracts, nbd