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 Details

    • index

      BulkUpdateBuilder index(@NonNull @NonNull Object object)
      Adds one or more index operations. If object is a collection or object array, each element is indexed separately.
    • index

      default BulkUpdateBuilder index(@NonNull @NonNull Object object, @NonNull @NonNull Object id)
      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

      BulkUpdateBuilder indexIfNotExists(@NonNull @NonNull Object object)
      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

      BulkUpdateBuilder delete(@NonNull @NonNull Object id)
      Adds a delete operation for the given document ID.
    • toBulkUpdates

      List<BulkUpdate> toBulkUpdates()
      Returns the currently configured update operations.
    • execute

      default CompletableFuture<Void> execute()
      Applies the configured update operations using Guarantee.STORED.
    • execute

      CompletableFuture<Void> execute(Guarantee guarantee)
      Applies the configured update operations using the given guarantee.
    • executeAndForget

      default void executeAndForget()
      Applies the configured update operations using Guarantee.NONE.
    • executeAndWait

      default void executeAndWait()
      Applies the configured update operations using Guarantee.STORED and waits for completion.
    • executeAndWait

      default void executeAndWait(Guarantee guarantee)
      Applies the configured update operations using the given guarantee and waits for completion.