Function cosmos_utils::maybe_modify
source · [−]pub async fn maybe_modify<D: Serialize + DeserializeOwned + Debug, P: Into<PartitionKeys>, F: Fn(D) -> Result<ModifyReturn<D>, Rejection>, C: ToString, S: ToString>(
collection_name: C,
pk: P,
document_id: S,
transform: F
) -> Result<ModifyReturn<D>, CosmosErrorStruct>Expand description
Modifies a document in cosmos by applying transform closure on the existing document and
either inserting the returned value or just returning it to the caller