Function cosmos_utils::modify [−][src]
pub async fn modify<D: Serialize + DeserializeOwned + Debug, P: Into<PartitionKeys>, F: Fn(D) -> Result<D, Rejection>, C: ToString, S: ToString>(
collection_name: C,
pk: P,
document_id: S,
transform: F
) -> Result<D, CosmosErrorStruct>Expand description
Modifies a document in cosmos by applying transform closure on the existing document and then
inserting the returned document and returning the transformed document if successful
If the transform closure fails then no insertion is performed and the error it fails with
is returned