ContainerBuilder Class

Definition

Container fluent definition for creation flows.

public class ContainerBuilder : Microsoft.Azure.Cosmos.Fluent.ContainerDefinition<Microsoft.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

ContainerBuilder(Database, String, String)

Creates an instance of ContainerBuilder .

Methods

Build()

Applies the current Fluent definition and creates a container configuration.

CreateAsync(Nullable<Int32>, CancellationToken)

Creates a container with the current fluent definition.

CreateAsync(ThroughputProperties, CancellationToken)

Creates a container with the current fluent definition.

CreateIfNotExistsAsync(Nullable<Int32>, CancellationToken)

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

CreateIfNotExistsAsync(ThroughputProperties, CancellationToken)

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

WithClientEncryptionPolicy()

Defines the ClientEncryptionPolicy for Azure Cosmos container. The PolicyFormatVersion will be set to 1. Note: If you need to include partition key or id field paths as part of ClientEncryptionPolicy, please set PolicyFormatVersion to 2.

WithClientEncryptionPolicy(Int32)

Defines the ClientEncryptionPolicy for Azure Cosmos container Note: If you need to include partition key or id field paths as part of ClientEncryptionPolicy, please set PolicyFormatVersion to 2.

WithConflictResolution()

Defined the conflict resolution 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>)
WithTimeToLivePropertyPath(String)

Sets the time to live base timestamp property path.

(Inherited from ContainerDefinition<T>)
WithUniqueKey()

Defines a Unique Key policy for this Azure Cosmos container.

WithVectorEmbeddingPolicy(Collection<Embedding>)

Defines the vector embedding policy for this Azure Cosmos container

Applies to