| 17 | } |
| 18 | |
| 19 | fn 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 | |
| 40 | fn filter(field: &str, op: &str, value: nodedb_types::Value) -> ScanFilter { |
| 41 | ScanFilter { |