Migration from Microsoft.Azure.DocumentDB to Microsoft.Azure.Cosmos package

Sanjay Kumar R (INFOSYS LIMITED) 1 Reputation point Microsoft External Staff
2022-07-25T05:52:06.323+00:00

what is the replacement of DeleteDocumentAsync , ReadDocumentAsync , UpsertDoumentAsync keywords in migration from documentDB to CosmosDb ?

Example: Query Azure Document DB for the document - ReadDocumentAsync
"ReadDocumentAsync (document,Key) "

Azure Migrate
Azure Migrate
A central hub of Azure cloud migration services and tools to discover, assess, and migrate workloads to the cloud.
925 questions
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,902 questions
Developer technologies | C#
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anurag Sharma 17,631 Reputation points
    2022-07-26T02:50:54.693+00:00

    Hi @Sanjay Kumar R (INFOSYS LIMITED) , welcome to Microsoft Q&A forum.

    You can use below equivalent when using the Microsoft.Azure.Cosmos package:

    DeleteDocumentAsync --> Container.DeleteItemAsync<T> Method

    ReadDocumentAsync --> Container.ReadItemAsync<T> Method

    UpsertDoumentAsync --> Container.UpsertItemAsync<T> Method

    Please let us know if this is what you are looking for, or else we can discuss further on the same.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.