Manipulating data with Core (SQL) API
The most common API for working with data in Azure Cosmos DB is Core (SQL).
The full documentation for Core (SQL) API can be found at the following link: https://docs.microsoft.com/en-us/azure/cosmos-db/sql/.
Performing CRUD operations with Cosmos SQL API
You can perform CRUD operations on JSON documents in Cosmos with SQL API by calling the following most common overloads of methods on an instance of the Microsoft.Azure.Cosmos.Container
class:
ReadItemAsync<T>(id, partitionKey)
: WhereT
is the item type to get,id
is its unique identifier, andpartitionKey
is its partition key value.ReadManyItemsAsync<T>(idsAndPartitionKeys)
: WhereT
is the item type to get, andidsAndPartitionKeys
are the unique identifiers and partition key values of a read-only list of items to retrieve.CreateItemAsync(object)
: Whereobject
is an instance of the item type to insert.DeleteItemAsync<T>...