Closed jeanmaried closed 10 months ago
Deleting by metadata sounds reasonable. I think the right way to approach it would be to overload the existing delete
method in a backwards compatible way
Something like:
From
def delete(self, ids: Iterable[str]) -> List[str]:
To
def delete(self, ids: Optional[Iterable[str]] = None, filters: Optional[Metadata] = None) -> List[str]:
where filters
goes through the same build_filter
logic as query
.
@olirice thank you, I updated the method and the docs.
very nice, thank you!
What kind of change does this PR introduce?
Feature
What is the current behavior?
I need to be able to delete vectors based solely on their metadata but currently the only way to do so is to already have the ids.
What is the new behavior?
I added 2 methods as suggestions. Option #1: add a
delete_by_metadata
Option #2:delete_vectors
(temporary name) a suggestion for updating the currentdelete
function to allow optionally passing the ids or metdata (one or the other).Please let me know which is an acceptable approach and if there are any objections to having this capability.