maybe_modify

Function maybe_modify 

Source
pub async fn maybe_modify<D: CosmosObject + DeserializeOwned + Debug, P: Into<PartitionKeyIntermediate>, 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