Share via


ContainerBuilder Class

Definition

CosmosContainer fluent definition for creation flows.

public class ContainerBuilder : Azure.Cosmos.Fluent.ContainerDefinition<Azure.Cosmos.Fluent.ContainerBuilder>
type ContainerBuilder = class
    inherit ContainerDefinition<ContainerBuilder>
Public Class ContainerBuilder
Inherits ContainerDefinition(Of ContainerBuilder)
Inheritance

Constructors

ContainerBuilder()

Creates an instance for unit-testing

Methods

Build()

Applies the current Fluent definition and creates a container configuration.

CreateAsync(Nullable<Int32>)

Creates a container with the current fluent definition.

CreateIfNotExistsAsync(Nullable<Int32>)

Creates a container if it does not exist with the current fluent definition.

WithConflictResolution()

Defined the conflict resoltuion for Azure Cosmos container

WithDefaultTimeToLive(Int32)

DefaultTimeToLive will be applied to all the items in the container as the default time-to-live policy. The individual item could override the default time-to-live policy by setting its time to live.

(Inherited from ContainerDefinition<T>)
WithDefaultTimeToLive(TimeSpan)

DefaultTimeToLive will be applied to all the items in the container as the default time-to-live policy. The individual item could override the default time-to-live policy by setting its time to live.

(Inherited from ContainerDefinition<T>)
WithIndexingPolicy()

IndexingPolicy definition for the current Azure Cosmos container.

(Inherited from ContainerDefinition<T>)
WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion)

Sets the PartitionKeyDefinitionVersion

The partition key definition version 1 uses a hash function that computes hash based on the first 100 bytes of the partition key. This can cause conflicts for documents with partition keys greater than 100 bytes.

The partition key definition version 2 uses a hash function that computes hash based on the first 2 KB of the partition key.

(Inherited from ContainerDefinition<T>)
WithUniqueKey()

Defines a Unique Key policy for this Azure Cosmos container.

Applies to