Interface BulkUpdateBuilder
public interface BulkUpdateBuilder
Fluent builder for applying multiple updates to a single document collection.
The builder stores update operations in order and applies them through the document store's
bulk update API when execute() is called.
Document IDs, timestamps, and collection metadata are inferred in the same way as
DocumentStore.prepareIndex(Object), while the collection is fixed by the builder.
Fluxzero.bulkUpdate("my_collection")
.index(doc1)
.delete(doc2Id)
.execute();
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionAdds a delete operation for the given document ID.default CompletableFuture<Void> execute()Applies the configured update operations usingGuarantee.STORED.Applies the configured update operations using the given guarantee.default voidApplies the configured update operations usingGuarantee.NONE.default voidApplies the configured update operations usingGuarantee.STOREDand waits for completion.default voidexecuteAndWait(Guarantee guarantee) Applies the configured update operations using the given guarantee and waits for completion.Adds one or more index operations.default BulkUpdateBuilderAdds an index operation using the supplied document ID.default BulkUpdateBuilderAdds an index operation using the supplied document ID and timestamp.Adds an index operation using the supplied document ID and time range.indexIfNotExists(@NonNull Object object) Adds one or more conditional index operations.default BulkUpdateBuilderindexIfNotExists(@NonNull Object object, @NonNull Object id) Adds a conditional index operation using the supplied document ID.default BulkUpdateBuilderindexIfNotExists(@NonNull Object object, @NonNull Object id, Instant timestamp) Adds a conditional index operation using the supplied document ID and timestamp.indexIfNotExists(@NonNull Object object, @NonNull Object id, Instant begin, Instant end) Adds a conditional index operation using the supplied document ID and time range.Returns the currently configured update operations.
-
Method Details
-
index
Adds one or more index operations. Ifobjectis a collection or object array, each element is indexed separately. -
index
Adds an index operation using the supplied document ID. -
index
default BulkUpdateBuilder index(@NonNull @NonNull Object object, @NonNull @NonNull Object id, Instant timestamp) Adds an index operation using the supplied document ID and timestamp. -
index
BulkUpdateBuilder index(@NonNull @NonNull Object object, @NonNull @NonNull Object id, Instant begin, Instant end) Adds an index operation using the supplied document ID and time range. -
indexIfNotExists
Adds one or more conditional index operations. Existing documents with the same ID will not be overwritten. -
indexIfNotExists
default BulkUpdateBuilder indexIfNotExists(@NonNull @NonNull Object object, @NonNull @NonNull Object id) Adds a conditional index operation using the supplied document ID. -
indexIfNotExists
default BulkUpdateBuilder indexIfNotExists(@NonNull @NonNull Object object, @NonNull @NonNull Object id, Instant timestamp) Adds a conditional index operation using the supplied document ID and timestamp. -
indexIfNotExists
BulkUpdateBuilder indexIfNotExists(@NonNull @NonNull Object object, @NonNull @NonNull Object id, Instant begin, Instant end) Adds a conditional index operation using the supplied document ID and time range. -
delete
Adds a delete operation for the given document ID. -
toBulkUpdates
List<BulkUpdate> toBulkUpdates()Returns the currently configured update operations. -
execute
Applies the configured update operations usingGuarantee.STORED. -
execute
Applies the configured update operations using the given guarantee. -
executeAndForget
default void executeAndForget()Applies the configured update operations usingGuarantee.NONE. -
executeAndWait
default void executeAndWait()Applies the configured update operations usingGuarantee.STOREDand waits for completion. -
executeAndWait
Applies the configured update operations using the given guarantee and waits for completion.
-