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

Method document_put_impl

nodedb-client/src/native/client/document.rs:52–71  ·  view source on GitHub ↗
(
        &self,
        collection: &str,
        doc: Document,
    )

Source from the content-addressed store, hash-verified

50 }
51
52 pub(super) async fn document_put_impl(
53 &self,
54 collection: &str,
55 doc: Document,
56 ) -> NodeDbResult<()> {
57 let data = sonic_rs::to_vec(&doc.fields)
58 .map_err(|e| NodeDbError::serialization("json", format!("doc serialize: {e}")))?;
59 let mut conn = self.pool.acquire().await?;
60 conn.send(
61 OpCode::PointPut,
62 TextFields {
63 collection: Some(collection.to_string()),
64 document_id: Some(doc.id.clone()),
65 data: Some(data),
66 ..Default::default()
67 },
68 )
69 .await?;
70 Ok(())
71 }
72
73 pub(super) async fn document_delete_impl(
74 &self,

Callers 1

document_putMethod · 0.45

Calls 5

serializationFunction · 0.85
to_stringMethod · 0.80
acquireMethod · 0.45
sendMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected