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

Function insert_product

nodedb/tests/executor_tests/test_array_ops.rs:19–38  ·  view source on GitHub ↗
(
    core: &mut nodedb::data::executor::core_loop::CoreLoop,
    tx: &mut nodedb_bridge::buffer::Producer<nodedb::bridge::dispatch::BridgeRequest>,
    rx: &mut nodedb_bridge::buffer::Consumer<nodedb

Source from the content-addressed store, hash-verified

17}
18
19fn insert_product(
20 core: &mut nodedb::data::executor::core_loop::CoreLoop,
21 tx: &mut nodedb_bridge::buffer::Producer<nodedb::bridge::dispatch::BridgeRequest>,
22 rx: &mut nodedb_bridge::buffer::Consumer<nodedb::bridge::dispatch::BridgeResponse>,
23 id: &str,
24 doc: serde_json::Value,
25) {
26 send_ok(
27 core,
28 tx,
29 rx,
30 PhysicalPlan::Document(DocumentOp::PointPut {
31 collection: "products".into(),
32 document_id: id.into(),
33 value: serde_json::to_vec(&doc).unwrap(),
34 surrogate: surrogate_for(id),
35 pk_bytes: id.as_bytes().to_vec(),
36 }),
37 );
38}
39
40fn filter(field: &str, op: &str, value: nodedb_types::Value) -> ScanFilter {
41 ScanFilter {

Callers 1

seedFunction · 0.70

Calls 5

DocumentClass · 0.85
send_okFunction · 0.70
surrogate_forFunction · 0.70
to_vecMethod · 0.45
as_bytesMethod · 0.45

Tested by

no test coverage detected