Interface Bulk
public interface Bulk
Container for an ordered list of
bulk operations that modify documents in one or more
collections within a single request. Execution can be ordered (serial, stop on first error) or
unordered (possibly parallel, continue on errors).- Since:
- 5.1
- Author:
- Christoph Strobl, Mark Paluch
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilder for definingbulk operationsacross one or more collections.static interfaceBuilder for adding bulk operations (insert, update, replace, remove) to a single collection. -
Method Summary
Modifier and TypeMethodDescriptionstatic Bulk.BulkBuilderbuilder()Returns a newBulk.BulkBuilderto define and build aBulk.static Bulkcreate(Consumer<Bulk.BulkBuilder> builderCustomizer) Creates a newBulkby applying the given builder customizer to a freshBulk.BulkBuilder.Returns the ordered list of bulk operations to execute.
-
Method Details
-
operations
List<BulkOperation> operations()Returns the ordered list of bulk operations to execute.- Returns:
- the ordered list of
operations.
-
create
Creates a newBulkby applying the given builder customizer to a freshBulk.BulkBuilder.- Parameters:
builderCustomizer- the customizer that configures the builder with operations.- Returns:
- a new
Bulkinstance.
-
builder
Returns a newBulk.BulkBuilderto define and build aBulk.Bulk bulk = Bulk.builder() .inCollection(Person.class, it -> it..insert(p1).upsert(where(...))) .inCollection("user", it -> it.update(where(...), ...) .build();- Returns:
- a new
Bulk.BulkBuilder.
-