Docs menu · Reference

Scans the collection for visible vectors matching the metadata filter and deletes the matching rows as a bulk mutation.

Successful mutations return an acknowledgement that identifies the affected target, the mutation effect, and commit facts when the operation changed stored state.

Examples

Delete every vector whose metadata matches a filter.

CLI

$ strata vector collection create docs 3 cosine
$ strata vector upsert docs a [1.0,0.0,0.0] --metadata {"tag":"keep"}
$ strata vector upsert docs b [0.0,1.0,0.0] --metadata {"tag":"drop"}
$ strata vector delete-by-filter docs {"conditions":[{"field":"tag","op":"eq","value":{"type":"string","value":"drop"}}]}
$ strata vector count docs

Wire

{"collection":"docs","dimension":3,"metric":"cosine","type":"vector_create_collection"}
{"collection":"docs","key":"a","metadata":{"tag":"keep"},"type":"vector_upsert","vector":[1.0,0.0,0.0]}
{"collection":"docs","key":"b","metadata":{"tag":"drop"},"type":"vector_upsert","vector":[0.0,1.0,0.0]}
{"collection":"docs","filter":{"conditions":[{"field":"tag","op":"eq","value":{"type":"string","value":"drop"}}]},"type":"vector_delete_by_filter"}
{"collection":"docs","type":"vector_count"}

Parameters

NameTypeRequiredDescription
collectionstringyesCollection name.
filterVectorMetadataFilteryesMetadata filter.

Plus the optional scope: branch and space (default to the session branch and the "default" space).

Returns

MutationAck<VectorBulkDelete>.

Errors

Invocation

  • CLI: strata vector delete-by-filter
  • Wire type: vector_delete_by_filter

agents: this page as markdown → /docs/reference/vector/delete_by_filter.md