2929 * make use of low level bulk commands on the protocol level. This interface defines a fluent API to add multiple single
3030 * operations or list of similar operations in sequence which can then eventually be executed by calling
3131 * {@link #execute()}.
32+ *
33+ * <pre class="code">
34+ * MongoTemplate template = …;
35+ *
36+ * template.bulkOps(BulkMode.UNORDERED, Person.class)
37+ * .insert(newPerson)
38+ * .updateOne(where("firstname").is("Joe"), Update.update("lastname", "Doe"))
39+ * .execute();
40+ * </pre>
3241 * <p>
3342 * Bulk operations are issued as one batch that pulls together all insert, update, and delete operations. Operations
3443 * that require individual operation results such as optimistic locking (using {@code @Version}) are not supported and
@@ -96,7 +105,7 @@ default BulkOperations updateOne(Query query, Update update) {
96105 * @param updates Update operations to perform.
97106 * @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}.
98107 */
99- BulkOperations updateOne (List <Pair <Query , Update >> updates );
108+ BulkOperations updateOne (List <Pair <Query , UpdateDefinition >> updates );
100109
101110 /**
102111 * Add a single update to the bulk operation. For the update request, all matching documents are updated.
@@ -125,7 +134,7 @@ default BulkOperations updateMulti(Query query, Update update) {
125134 * @param updates Update operations to perform.
126135 * @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}.
127136 */
128- BulkOperations updateMulti (List <Pair <Query , Update >> updates );
137+ BulkOperations updateMulti (List <Pair <Query , UpdateDefinition >> updates );
129138
130139 /**
131140 * Add a single upsert to the bulk operation. An upsert is an update if the set of matching documents is not empty,
@@ -180,7 +189,7 @@ default BulkOperations upsert(Query query, Update update) {
180189 *
181190 * @param query Update criteria.
182191 * @param replacement the replacement document. Must not be {@literal null}.
183- * @return the current {@link BulkOperations} instance with the replace added, will never be {@literal null}.
192+ * @return the current {@link BulkOperations} instance with the replacement added, will never be {@literal null}.
184193 * @since 2.2
185194 */
186195 default BulkOperations replaceOne (Query query , Object replacement ) {
@@ -193,7 +202,7 @@ default BulkOperations replaceOne(Query query, Object replacement) {
193202 * @param query Update criteria.
194203 * @param replacement the replacement document. Must not be {@literal null}.
195204 * @param options the {@link FindAndModifyOptions} holding additional information. Must not be {@literal null}.
196- * @return the current {@link BulkOperations} instance with the replace added, will never be {@literal null}.
205+ * @return the current {@link BulkOperations} instance with the replacement added, will never be {@literal null}.
197206 * @since 2.2
198207 */
199208 BulkOperations replaceOne (Query query , Object replacement , FindAndReplaceOptions options );
0 commit comments