CosmosContainer Class

Definition

Operations for reading, replacing, or deleting a specific, existing container or item in a container by id. There are two different types of operations.

  1. The object operations where it serializes and deserializes the item on request/response
  2. The stream response which takes a Stream containing a JSON serialized object and returns a response containing a Stream CosmosDatabase for creating new containers, and reading/querying all containers;
public abstract class CosmosContainer
type CosmosContainer = class
Public MustInherit Class CosmosContainer
Inheritance
System.Object
CosmosContainer

Remarks

Note: all these operations make calls against a fixed budget. You should design your system such that these calls scale sub linearly with your application. For instance, do not call `container.readAsync()` before every single `item.read()` call, to ensure the cosmosContainer exists; do this once on application start up.

Constructors

CosmosContainer()

Properties

Conflicts

Returns the conflicts

Id

The Id of the Cosmos container

Scripts

Returns the scripts

Methods

CreateItemAsync<T>(T, Nullable<PartitionKey>, ItemRequestOptions, CancellationToken)

Creates a item as an asynchronous operation in the Azure Cosmos service.

CreateItemStreamAsync(Stream, PartitionKey, ItemRequestOptions, CancellationToken)

Creates a Item as an asynchronous operation in the Azure Cosmos service.

DeleteContainerAsync(ContainerRequestOptions, CancellationToken)

Delete a ContainerProperties from the Azure Cosmos DB service as an asynchronous operation.

DeleteContainerStreamAsync(ContainerRequestOptions, CancellationToken)

Delete a ContainerProperties from the Azure Cosmos DB service as an asynchronous operation.

DeleteItemAsync<T>(String, PartitionKey, ItemRequestOptions, CancellationToken)

Delete a item from the Azure Cosmos service as an asynchronous operation.

DeleteItemStreamAsync(String, PartitionKey, ItemRequestOptions, CancellationToken)

Delete a item from the Azure Cosmos service as an asynchronous operation.

GetItemQueryIterator<T>(QueryDefinition, String, QueryRequestOptions, CancellationToken)

This method creates a query for items under a container in an Azure Cosmos database using a SQL statement with parameterized values. It returns a FeedIterator. For more information on preparing SQL statements with parameterized values, please see QueryDefinition.

GetItemQueryIterator<T>(String, String, QueryRequestOptions, CancellationToken)

This method creates a query for items under a container in an Azure Cosmos database using a SQL statement with parameterized values. It returns a FeedIterator. For more information on preparing SQL statements with parameterized values, please see QueryDefinition.

GetItemQueryStreamIterator(QueryDefinition, String, QueryRequestOptions, CancellationToken)

This method creates a query for items under a container in an Azure Cosmos database using a SQL statement with parameterized values. It returns a FeedIterator. For more information on preparing SQL statements with parameterized values, please see QueryDefinition.

GetItemQueryStreamIterator(String, String, QueryRequestOptions, CancellationToken)

This method creates a query for items under a container in an Azure Cosmos database using a SQL statement with parameterized values. It returns a FeedIterator. For more information on preparing SQL statements with parameterized values, please see QueryDefinition.

ReadContainerAsync(ContainerRequestOptions, CancellationToken)

Reads a ContainerProperties from the Azure Cosmos service as an asynchronous operation.

ReadContainerStreamAsync(ContainerRequestOptions, CancellationToken)

Reads a ContainerProperties from the Azure Cosmos service as an asynchronous operation.

ReadItemAsync<T>(String, PartitionKey, ItemRequestOptions, CancellationToken)

Reads a item from the Azure Cosmos service as an asynchronous operation.

ReadItemStreamAsync(String, PartitionKey, ItemRequestOptions, CancellationToken)

Reads a item from the Azure Cosmos service as an asynchronous operation.

ReadThroughputAsync(CancellationToken)

Gets container throughput in measurement of request units per second in the Azure Cosmos service.

ReadThroughputAsync(RequestOptions, CancellationToken)

Gets container throughput in measurement of request units per second in the Azure Cosmos service.

ReplaceContainerAsync(ContainerProperties, ContainerRequestOptions, CancellationToken)

Replace a ContainerProperties from the Azure Cosmos service as an asynchronous operation.

ReplaceContainerStreamAsync(ContainerProperties, ContainerRequestOptions, CancellationToken)

Replace a ContainerProperties from the Azure Cosmos service as an asynchronous operation.

ReplaceItemAsync<T>(T, String, Nullable<PartitionKey>, ItemRequestOptions, CancellationToken)

Replaces a item in the Azure Cosmos service as an asynchronous operation.

ReplaceItemStreamAsync(Stream, String, PartitionKey, ItemRequestOptions, CancellationToken)

Replaces a item in the Azure Cosmos service as an asynchronous operation.

ReplaceThroughputAsync(Int32, RequestOptions, CancellationToken)

Sets throughput provisioned for a container in measurement of request units per second in the Azure Cosmos service.

UpsertItemAsync<T>(T, Nullable<PartitionKey>, ItemRequestOptions, CancellationToken)

Upserts an item as an asynchronous operation in the Azure Cosmos service.

UpsertItemStreamAsync(Stream, PartitionKey, ItemRequestOptions, CancellationToken)

Upserts an item stream as an asynchronous operation in the Azure Cosmos service.

Applies to