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

Method remove

nodedb/src/engine/kv/index.rs:58–68  ·  view source on GitHub ↗

Remove a (value, primary_key) pair from the index. Returns true if the pair was found and removed.

(&mut self, field_value: &[u8], primary_key: &[u8])

Source from the content-addressed store, hash-verified

56 ///
57 /// Returns true if the pair was found and removed.
58 pub fn remove(&mut self, field_value: &[u8], primary_key: &[u8]) -> bool {
59 if let Some(keys) = self.tree.get_mut(field_value) {
60 let removed = keys.remove(primary_key);
61 if keys.is_empty() {
62 self.tree.remove(field_value);
63 }
64 removed
65 } else {
66 false
67 }
68 }
69
70 /// Exact-match lookup: find all primary keys where field == value.
71 pub fn lookup_eq(&self, field_value: &[u8]) -> Vec<&[u8]> {

Callers 15

clearFunction · 0.45
poll_responsesMethod · 0.45
forgetMethod · 0.45
truncateMethod · 0.45
purge_collectionMethod · 0.45
purge_tenantMethod · 0.45
rename_collectionMethod · 0.45
remove_indexMethod · 0.45
on_putMethod · 0.45
on_deleteMethod · 0.45
evict_oneMethod · 0.45

Calls 2

get_mutMethod · 0.45
is_emptyMethod · 0.45