You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BulkOperations is an Spring Framework Data interface that contains a list of write
42
-
operations that can be applied to your database. They can be any combination of
43
-
the following operations which map to similar {+driver-short+} operations:
55
+
operations that can be applied to your database. It can handle any combination of
56
+
the following operations which map to similar {+driver-long+} operations:
44
57
45
58
- ``insert``
46
59
- ``updateOne``
@@ -50,10 +63,10 @@ the following operations which map to similar {+driver-short+} operations:
50
63
- ``deleteMany``
51
64
- ``upsert``
52
65
53
-
A BulkOperation can be ordered or unordered. Ordered operations will be applied
54
-
sequentially and if an error is detected, will return with an error code.
55
-
Unordered operations will be applied in parallel, which means they can be
56
-
faster. However, you must check if there were errors during the operations.
66
+
A BulkOperation can be ordered or unordered. Ordered bulk operations run operations
67
+
sequentially, and if an error is detected, return with an error code.
68
+
Unordered operations are run in parallel, which means they are typically faster
69
+
faster. However, you must manually check if there were errors during the operations.
57
70
58
71
For more information about bulk operations, see the following resources:
59
72
@@ -72,7 +85,7 @@ You can find the completed sample app for this tutorial in the
72
85
73
86
.. note:: Imports Not specified
74
87
75
-
The import statements required for the classes in the tutorial have not been included. See the :github:`GitHub repository</mongodb-developer/SpringDataMongoBulkInsert>` for complete files.
88
+
The import statements required for the files in the tutorial have not been included on the page. See the :github:`GitHub repository</mongodb-developer/SpringDataMongoBulkInsert>` for complete files.
76
89
77
90
Prerequisites
78
91
~~~~~~~~~~~~~
@@ -81,11 +94,9 @@ Ensure you have the following components installed and set up before you start
81
94
this tutorial:
82
95
83
96
- `Java 8 or later <https://www.oracle.com/java/technologies/downloads/>`__
84
-
- A MongoDB Atlas cluster
85
-
To learn how to set up a cluster, see the :ref:`Getting Started
- A :atlas:`MongoDB Atlas cluster </getting-started?tck=docs_driver_java>`
99
+
- A new `Spring Boot application <https://spring.io/guides/gs/spring-boot>`__
89
100
90
101
Add Dependencies
91
102
~~~~~~~~~~~~~~~~
@@ -97,16 +108,26 @@ the `Requirements
97
108
of the Spring Data MongoDB documentation, and the :ref:`Compatibility
98
109
<java-compatibility-tables>` page of this guide.
99
110
100
-
Add the dependency to your ``pom.xml``:
111
+
.. note::
112
+
113
+
If you used the `Spring Initializr <https://start.spring.io/>`__ or a clone of the :github:`Spring Boot sample project <spring-guides/gs-spring-boot>` to create your project, versioning compatibility has already been accounted for, and the ``spring-boot-starter-data-mongodb`` component will already be included in your ``pom.xml`` file.
@@ -219,7 +247,11 @@ Create a main application class, trigger the bulk insert on startup:
219
247
Conclusion
220
248
----------
221
249
222
-
Implementing bulk writes in Spring Boot with MongoDB significantly improves performance by minimizing database round trips. By following the steps in this tutorial, you can efficiently manage batch data operations in your applications.
250
+
Spring Data MongoDB provides a high-level abstraction for working with MongoDB.
251
+
It can simplify application architecture by supporting automatic dependency
252
+
injection, which eliminates the need for manual client configuration and complex
253
+
query handling. By reducing boilerplate code and supporting object-oriented data access, it can
254
+
streamline data access and promote a clear separation of concerns.
0 commit comments