WeaviateEx.Batch.DeleteResult (WeaviateEx v0.7.4)

View Source

Typed result for batch delete operations.

Contains information about the delete operation including matches, successes, failures, and optionally the deleted objects.

Examples

# Parse a delete response
{:ok, result} = DeleteResult.from_api(response)

# Check statistics
result.matches    # Total objects matching filter
result.successful # Successfully deleted count
result.failed     # Failed deletion count

# Access deleted objects (if verbose output requested)
Enum.each(result.objects, fn obj ->
  IO.puts("Deleted: #{obj.uuid}")
end)

Summary

Functions

Check if all matched objects were successfully deleted.

Get objects that failed to delete.

Parse a delete result from the Weaviate API response.

Check if any deletions failed.

Get objects that were successfully deleted.

Get a summary of the delete operation.

Types

t()

@type t() :: %WeaviateEx.Batch.DeleteResult{
  dry_run: boolean(),
  failed: non_neg_integer(),
  limit: non_neg_integer(),
  matches: non_neg_integer(),
  objects: [WeaviateEx.Batch.DeleteResult.DeletedObject.t()],
  successful: non_neg_integer()
}

Functions

all_successful?(result)

@spec all_successful?(t()) :: boolean()

Check if all matched objects were successfully deleted.

failed_objects(result)

@spec failed_objects(t()) :: [WeaviateEx.Batch.DeleteResult.DeletedObject.t()]

Get objects that failed to delete.

from_api(response)

@spec from_api(map()) :: {:ok, t()} | {:error, term()}

Parse a delete result from the Weaviate API response.

Examples

response = %{
  "match" => %{"matches" => 10, "limit" => 10000},
  "output" => "verbose",
  "results" => %{
    "successful" => 10,
    "failed" => 0,
    "objects" => [%{"id" => "uuid-1", "status" => "SUCCESS"}]
  }
}
{:ok, result} = DeleteResult.from_api(response)

has_failures?(result)

@spec has_failures?(t()) :: boolean()

Check if any deletions failed.

successful_objects(result)

@spec successful_objects(t()) :: [WeaviateEx.Batch.DeleteResult.DeletedObject.t()]

Get objects that were successfully deleted.

summary(result)

@spec summary(t()) :: String.t()

Get a summary of the delete operation.