(
&self,
collection: &str,
doc: Document,
)
| 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, |
no test coverage detected