modify_async_get_old

Function modify_async_get_old 

Source
pub async fn modify_async_get_old<D: CosmosObject + DeserializeOwned + Clone, P: Into<PartitionKeyIntermediate>, F: Fn(D) -> Fut, C: ToString, S: ToString, Fut: Future<Output = Result<D, Rejection>>>(
    collection_name: C,
    pk: P,
    document_id: S,
    transform: F,
) -> Result<(D, D, String), CosmosErrorStruct>
Expand description

Modifies a document in cosmos by applying transform async closure on the existing document and then inserting the returned document and returning both the transformed document, the old document and the etag if successful. If the transform closure fails then no insertion is performed and the error it fails with is returned