-
Notifications
You must be signed in to change notification settings - Fork 43
DOCSP-41769: Improved bulk write API #590
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
Changes from 18 commits
72b9e73
09d5786
161ffec
9d37fac
5e577ba
78d26c0
db24b1e
56413a0
7308593
c30dacd
08baf89
fa4ff13
578cb8d
1c94b5c
ad5ea28
d9a33d9
02b1720
ef63a45
1cfd451
7110a7f
68e6074
9934475
f43f5c9
605cf7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -10,28 +10,51 @@ Bulk Operations | |||||||||||
:depth: 2 | ||||||||||||
:class: singlecol | ||||||||||||
|
||||||||||||
.. meta:: | ||||||||||||
:keywords: insert, update, replace, code example, efficiency | ||||||||||||
|
||||||||||||
Overview | ||||||||||||
-------- | ||||||||||||
|
||||||||||||
In this guide, you can learn how to use bulk operations in the | ||||||||||||
MongoDB Java Driver. | ||||||||||||
|
||||||||||||
To perform a create, replace, update, or delete operation, | ||||||||||||
use its corresponding method. For example, to insert one document, | ||||||||||||
update multiple documents, and delete one document in your collection, | ||||||||||||
use the ``insertOne()``, ``updateMany()`` and ``deleteOne()`` methods. | ||||||||||||
To perform a single create, replace, update, or delete operation, you can use | ||||||||||||
the corresponding method. For example, to insert one document and replace one | ||||||||||||
document, you can use the ``insertOne()`` and ``replaceOne()`` methods. In this | ||||||||||||
case, the ``MongoClient`` makes a call to the database for each operation. | ||||||||||||
|
document, you can use the ``insertOne()`` and ``replaceOne()`` methods. In this | |
case, the ``MongoClient`` makes a call to the database for each operation. | |
document, you can use the ``insertOne()`` and ``replaceOne()`` methods. When you | |
use these methods, the ``MongoClient`` makes one call to the database for each operation. |
Outdated
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: 'generally' is a little vague. we can just state a fact instead
Generally, you can reduce the number of calls to the database by using bulk write | |
operations. You can perform bulk write operations at the following levels: | |
By using a bulk write operation, you can perform multiple write operations | |
in a single database call. You can perform bulk write operations at the following levels: |
Outdated
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.
- :ref:`Collection Level <java-sync-coll-bulk-write>`: You can use the | |
- :ref:`Collection <java-sync-coll-bulk-write>`: You can use the |
stIncMale marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
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.
- :ref:`Client Level <java-sync-client-bulk-write>`: When running {+mdb-server+} | |
- :ref:`Client <java-sync-client-bulk-write>`: When running {+mdb-server+} |
Outdated
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.
- :ref:`Client Level <java-sync-client-bulk-write>`: When running {+mdb-server+} | |
version 8.0 or later, you can use the ``MongoClient.bulkWrite()`` method to perform | |
- :ref:`Client Level <java-sync-client-bulk-write>`: If your application connects to | |
{+mdb-server+} version 8.0 or later, you can use the ``MongoClient.bulkWrite()`` | |
method to perform |
Outdated
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.
This method groups multiple kinds of write operations into one call. | |
This method performs all write operations in one database call. |
stIncMale marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
stIncMale marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
mayaraman19 marked this conversation as resolved.
Show resolved
Hide resolved
Outdated
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: if someone jumps straight to this section, they might not see that this line is intended to compare client bulk writes to collection bulk writes.
to multiple databases and collections in the same cluster. The ``MongoClient.bulkWrite()`` | |
method does not split different kinds of operations into different batches. | |
to multiple databases and collections in the same cluster. The ``MongoClient.bulkWrite()`` | |
method performs all write operation in a single batch. |
Outdated
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: unfortunately, i think it's worth repeating the info from earlier in the page just to users don't have to read earlier sections if they don't need to. if you have a lot of repeated content, you can always put it in an includes
directive 😎
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.
honestly, I'm not sure how much this information is relevant so I will remove it 👍
Outdated
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.
for comprehensiveness and clarity, we probably want to specify which methods take what. you could give each method its own subsection, or add a parameter list/table for each one
Uh oh!
There was an error while loading. Please reload this page.