MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / delete_multi_vector

Method delete_multi_vector

nodedb-vector/src/collection/lifecycle_insert_ops.rs:52–65  ·  view source on GitHub ↗

Delete all vectors belonging to a multi-vector document.

(&mut self, document_surrogate: Surrogate)

Source from the content-addressed store, hash-verified

50
51 /// Delete all vectors belonging to a multi-vector document.
52 pub fn delete_multi_vector(&mut self, document_surrogate: Surrogate) -> usize {
53 let Some(ids) = self.multi_doc_map.remove(&document_surrogate) else {
54 return 0;
55 };
56 let mut deleted = 0;
57 for id in &ids {
58 if self.delete(*id) {
59 deleted += 1;
60 }
61 self.surrogate_map.remove(id);
62 }
63 self.surrogate_to_local.remove(&document_surrogate);
64 deleted
65 }
66
67 /// Look up the surrogate for a global vector ID.
68 pub fn get_surrogate(&self, vector_id: u32) -> Option<Surrogate> {

Calls 2

removeMethod · 0.45
deleteMethod · 0.45