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

Method sorted_index_on_put

nodedb/src/engine/kv/engine_sorted.rs:53–62  ·  view source on GitHub ↗

Called after a KV PUT to maintain sorted indexes on this collection. `field_values` are the extracted field name/value pairs from the new value.

(
        &mut self,
        tenant_id: u64,
        collection: &str,
        primary_key: &[u8],
        field_values: &[(String, Vec<u8>)],
    )

Source from the content-addressed store, hash-verified

51 ///
52 /// `field_values` are the extracted field name/value pairs from the new value.
53 pub fn sorted_index_on_put(
54 &mut self,
55 tenant_id: u64,
56 collection: &str,
57 primary_key: &[u8],
58 field_values: &[(String, Vec<u8>)],
59 ) {
60 let tkey = table_key(tenant_id, collection);
61 self.sorted_indexes.on_put(tkey, primary_key, field_values);
62 }
63
64 /// Called after a KV DELETE to maintain sorted indexes on this collection.
65 pub fn sorted_index_on_delete(&mut self, tenant_id: u64, collection: &str, primary_key: &[u8]) {

Callers

nothing calls this directly

Calls 2

table_keyFunction · 0.85
on_putMethod · 0.45

Tested by

no test coverage detected