Share via


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

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 `container.readItemAsync()` call to ensure the container exists; do this once on application start up.

Constructors

Container()

Properties

Conflicts

Returns the conflicts

Database

Returns the parent Database reference

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.

CreateTransactionalBatch(PartitionKey)

Initializes a new instance of TransactionalBatch that can be used to perform operations across multiple items in the container with the provided partition key in a transactional manner.

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.

GetChangeFeedEstimator(String, Container)

Gets a ChangeFeedEstimator for change feed monitoring.

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

Initializes a ChangeFeedProcessorBuilder for change feed monitoring.

GetChangeFeedIterator<T>(ChangeFeedStartFrom, ChangeFeedMode, ChangeFeedRequestOptions)

This method creates an iterator to consume a Change Feed.

GetChangeFeedProcessorBuilder(String, Container+ChangeFeedStreamHandler)

Initializes a ChangeFeedProcessorBuilder for change feed processing.

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

Initializes a ChangeFeedProcessorBuilder for change feed processing.

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

Initializes a ChangeFeedProcessorBuilder for change feed processing.

GetChangeFeedProcessorBuilderWithManualCheckpoint(String, Container+ChangeFeedStreamHandlerWithManualCheckpoint)

Initializes a ChangeFeedProcessorBuilder for change feed processing with manual checkpoint.

GetChangeFeedProcessorBuilderWithManualCheckpoint<T>(String, Container.ChangeFeedHandlerWithManualCheckpoint<T>)

Initializes a ChangeFeedProcessorBuilder for change feed processing with manual checkpoint.

GetChangeFeedStreamIterator(ChangeFeedStartFrom, ChangeFeedMode, ChangeFeedRequestOptions)

This method creates an iterator to consume a Change Feed.

GetFeedRangesAsync(CancellationToken)

Obtains a list of FeedRange that can be used to parallelize Feed operations.

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

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>(FeedRange, 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>(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)

This method creates a query for items under a container in an Azure Cosmos database using a SQL statement. It returns a FeedIterator.

GetItemQueryStreamIterator(FeedRange, 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.

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.

GetItemQueryStreamIterator(String, String, QueryRequestOptions)

This method creates a query for items under a container in an Azure Cosmos database using a SQL statement. It returns a FeedIterator.

PatchItemAsync<T>(String, PartitionKey, IReadOnlyList<PatchOperation>, PatchItemRequestOptions, CancellationToken)

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

PatchItemStreamAsync(String, PartitionKey, IReadOnlyList<PatchOperation>, PatchItemRequestOptions, CancellationToken)

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

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.

ReadManyItemsAsync<T>(IReadOnlyList<ValueTuple<String,PartitionKey>>, ReadManyRequestOptions, CancellationToken)

Reads multiple items from a container using Id and PartitionKey values.

ReadManyItemsStreamAsync(IReadOnlyList<ValueTuple<String,PartitionKey>>, ReadManyRequestOptions, CancellationToken)

Reads multiple items from a container using Id and PartitionKey values.

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.

ReplaceThroughputAsync(ThroughputProperties, 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