Container Container Container 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 Database for creating new containers, and reading/querying all containers;
public abstract class Container
type Container = class
Public MustInherit Class Container
Inheritance
ContainerContainerContainer

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

Container() Container() Container()

Properties

Conflicts Conflicts Conflicts

Returns the conflicts

Id Id Id

The Id of the Cosmos container

Scripts Scripts Scripts

Returns the scripts

Methods

CreateBatch(PartitionKey) CreateBatch(PartitionKey) CreateBatch(PartitionKey)

Initializes a new instance of the Batch class.

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

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

CreateItemStreamAsync(Stream, PartitionKey, ItemRequestOptions, CancellationToken) CreateItemStreamAsync(Stream, PartitionKey, ItemRequestOptions, CancellationToken) CreateItemStreamAsync(Stream, PartitionKey, ItemRequestOptions, CancellationToken)

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

DeleteContainerAsync(ContainerRequestOptions, CancellationToken) DeleteContainerAsync(ContainerRequestOptions, CancellationToken) DeleteContainerAsync(ContainerRequestOptions, CancellationToken)

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

DeleteContainerStreamAsync(ContainerRequestOptions, CancellationToken) DeleteContainerStreamAsync(ContainerRequestOptions, CancellationToken) DeleteContainerStreamAsync(ContainerRequestOptions, CancellationToken)

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

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

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

DeleteItemStreamAsync(String, PartitionKey, ItemRequestOptions, CancellationToken) DeleteItemStreamAsync(String, PartitionKey, ItemRequestOptions, CancellationToken) DeleteItemStreamAsync(String, PartitionKey, ItemRequestOptions, CancellationToken)

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

GetChangeFeedEstimatorBuilder(String, Container+ChangesEstimationHandler, Nullable<TimeSpan>) GetChangeFeedEstimatorBuilder(String, Container+ChangesEstimationHandler, Nullable<TimeSpan>) GetChangeFeedEstimatorBuilder(String, Container+ChangesEstimationHandler, Nullable<TimeSpan>)

Initializes a ChangeFeedProcessorBuilder for change feed monitoring.

GetChangeFeedProcessorBuilder<T>(String, Container) GetChangeFeedProcessorBuilder<T>(String, Container) GetChangeFeedProcessorBuilder<T>(String, Container)

Initializes a ChangeFeedProcessorBuilder for change feed processing.

GetItemLinqQueryable<T>(Boolean, String, QueryRequestOptions) GetItemLinqQueryable<T>(Boolean, String, QueryRequestOptions) GetItemLinqQueryable<T>(Boolean, String, QueryRequestOptions)

This method creates a LINQ query for items under a container in an Azure Cosmos DB service. IQueryable extension method ToFeedIterator() should be use for asynchronous execution with FeedIterator, please refer to example 2.

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

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) GetItemQueryIterator<T>(String, String, QueryRequestOptions) GetItemQueryIterator<T>(String, String, QueryRequestOptions)

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) GetItemQueryStreamIterator(String, String, QueryRequestOptions) GetItemQueryStreamIterator(String, String, QueryRequestOptions)

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) GetItemQueryStreamIterator(QueryDefinition, String, QueryRequestOptions) GetItemQueryStreamIterator(QueryDefinition, String, QueryRequestOptions)

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) ReadContainerAsync(ContainerRequestOptions, CancellationToken) ReadContainerAsync(ContainerRequestOptions, CancellationToken)

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

ReadContainerStreamAsync(ContainerRequestOptions, CancellationToken) ReadContainerStreamAsync(ContainerRequestOptions, CancellationToken) ReadContainerStreamAsync(ContainerRequestOptions, CancellationToken)

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

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

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

ReadItemStreamAsync(String, PartitionKey, ItemRequestOptions, CancellationToken) ReadItemStreamAsync(String, PartitionKey, ItemRequestOptions, CancellationToken) ReadItemStreamAsync(String, PartitionKey, ItemRequestOptions, CancellationToken)

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

ReadThroughputAsync(CancellationToken) ReadThroughputAsync(CancellationToken) ReadThroughputAsync(CancellationToken)

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

ReadThroughputAsync(RequestOptions, CancellationToken) ReadThroughputAsync(RequestOptions, CancellationToken) ReadThroughputAsync(RequestOptions, CancellationToken)

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

ReplaceContainerAsync(ContainerProperties, ContainerRequestOptions, CancellationToken) ReplaceContainerAsync(ContainerProperties, ContainerRequestOptions, CancellationToken) ReplaceContainerAsync(ContainerProperties, ContainerRequestOptions, CancellationToken)

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

ReplaceContainerStreamAsync(ContainerProperties, ContainerRequestOptions, CancellationToken) ReplaceContainerStreamAsync(ContainerProperties, ContainerRequestOptions, CancellationToken) ReplaceContainerStreamAsync(ContainerProperties, ContainerRequestOptions, CancellationToken)

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

ReplaceItemAsync<T>(T, String, Nullable<PartitionKey>, ItemRequestOptions, CancellationToken) ReplaceItemAsync<T>(T, String, Nullable<PartitionKey>, ItemRequestOptions, CancellationToken) 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) ReplaceItemStreamAsync(Stream, String, PartitionKey, ItemRequestOptions, CancellationToken) ReplaceItemStreamAsync(Stream, String, PartitionKey, ItemRequestOptions, CancellationToken)

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

ReplaceThroughputAsync(Int32, RequestOptions, CancellationToken) ReplaceThroughputAsync(Int32, RequestOptions, CancellationToken) 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) UpsertItemAsync<T>(T, Nullable<PartitionKey>, ItemRequestOptions, CancellationToken) UpsertItemAsync<T>(T, Nullable<PartitionKey>, ItemRequestOptions, CancellationToken)

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

UpsertItemStreamAsync(Stream, PartitionKey, ItemRequestOptions, CancellationToken) UpsertItemStreamAsync(Stream, PartitionKey, ItemRequestOptions, CancellationToken) UpsertItemStreamAsync(Stream, PartitionKey, ItemRequestOptions, CancellationToken)

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

Applies to