xml/Azure.Cosmos/ContainerProperties.xml (359 lines of code) (raw):

<Type Name="ContainerProperties" FullName="Azure.Cosmos.ContainerProperties"> <TypeSignature Language="C#" Value="public class ContainerProperties" /> <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ContainerProperties extends System.Object" /> <TypeSignature Language="DocId" Value="T:Azure.Cosmos.ContainerProperties" /> <TypeSignature Language="VB.NET" Value="Public Class ContainerProperties" /> <TypeSignature Language="F#" Value="type ContainerProperties = class" /> <AssemblyInfo> <AssemblyName>Azure.Cosmos</AssemblyName> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> <Base> <BaseTypeName>System.Object</BaseTypeName> </Base> <Interfaces /> <Attributes> <Attribute> <AttributeName Language="C#">[System.Text.Json.Serialization.JsonConverter(typeof(Azure.Cosmos.TextJsonContainerPropertiesConverter))]</AttributeName> <AttributeName Language="F#">[&lt;System.Text.Json.Serialization.JsonConverter(typeof(Azure.Cosmos.TextJsonContainerPropertiesConverter))&gt;]</AttributeName> </Attribute> </Attributes> <Docs> <summary> Represents a document container in the Azure Cosmos DB service. A container is a named logical container for documents. </summary> <remarks> A database may contain zero or more named containers and each container consists of zero or more JSON documents. Being schema-free, the documents in a container do not need to share the same structure or fields. Since containers are application resources, they can be authorized using either the master key or resource keys. Refer to <see>http://azure.microsoft.com/documentation/articles/documentdb-resources/#collections</see> for more details on containers. </remarks> <altmember cref="P:Azure.Cosmos.ContainerProperties.IndexingPolicy" /> <example> The example below creates a new partitioned container with 50000 Request-per-Unit throughput. The partition key is the first level 'country' property in all the documents within this container. <code language="c#"><![CDATA[ Container container = await client.GetDatabase("dbName"].Containers.CreateAsync("MyCollection", "/country", 50000} ); ContainerProperties containerProperties = container.Resource; ]]></code></example> <example> The example below creates a new container with a custom indexing policy. <code language="c#"><![CDATA[ ContainerProperties containerProperties = new ContainerProperties("MyCollection", "/country"); containerProperties.IndexingPolicy.Automatic = true; containerProperties.IndexingPolicy.IndexingMode = IndexingMode.Consistent; CosmosContainerResponse containerCreateResponse = await client.GetDatabase("dbName"].CreateContainerAsync(containerProperties, 50000); ContainerProperties createdContainerProperties = containerCreateResponse.Container; ]]></code></example> <example> The example below deletes this container. <code language="c#"><![CDATA[ Container container = client.GetDatabase("dbName"].Containers["MyCollection"]; await container.DeleteAsync(); ]]></code></example> <altmember cref="P:Azure.Cosmos.ContainerProperties.UniqueKeyPolicy" /> </Docs> <Members> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public ContainerProperties ();" /> <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> <MemberSignature Language="DocId" Value="M:Azure.Cosmos.ContainerProperties.#ctor" /> <MemberSignature Language="VB.NET" Value="Public Sub New ()" /> <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyName>Azure.Cosmos</AssemblyName> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> <Parameters /> <Docs> <summary> Initializes a new instance of the <see cref="T:Azure.Cosmos.ContainerProperties" /> class for the Azure Cosmos DB service. </summary> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public ContainerProperties (string id, string partitionKeyPath);" /> <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string id, string partitionKeyPath) cil managed" /> <MemberSignature Language="DocId" Value="M:Azure.Cosmos.ContainerProperties.#ctor(System.String,System.String)" /> <MemberSignature Language="VB.NET" Value="Public Sub New (id As String, partitionKeyPath As String)" /> <MemberSignature Language="F#" Value="new Azure.Cosmos.ContainerProperties : string * string -&gt; Azure.Cosmos.ContainerProperties" Usage="new Azure.Cosmos.ContainerProperties (id, partitionKeyPath)" /> <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyName>Azure.Cosmos</AssemblyName> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> <Parameters> <Parameter Name="id" Type="System.String" /> <Parameter Name="partitionKeyPath" Type="System.String" /> </Parameters> <Docs> <param name="id">The Id of the resource in the Azure Cosmos service.</param> <param name="partitionKeyPath">The path to the partition key. Example: /location</param> <summary> Initializes a new instance of the <see cref="T:Azure.Cosmos.ContainerProperties" /> class for the Azure Cosmos DB service. </summary> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName="ConflictResolutionPolicy"> <MemberSignature Language="C#" Value="public Azure.Cosmos.ConflictResolutionPolicy ConflictResolutionPolicy { get; set; }" /> <MemberSignature Language="ILAsm" Value=".property instance class Azure.Cosmos.ConflictResolutionPolicy ConflictResolutionPolicy" /> <MemberSignature Language="DocId" Value="P:Azure.Cosmos.ContainerProperties.ConflictResolutionPolicy" /> <MemberSignature Language="VB.NET" Value="Public Property ConflictResolutionPolicy As ConflictResolutionPolicy" /> <MemberSignature Language="F#" Value="member this.ConflictResolutionPolicy : Azure.Cosmos.ConflictResolutionPolicy with get, set" Usage="Azure.Cosmos.ContainerProperties.ConflictResolutionPolicy" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyName>Azure.Cosmos</AssemblyName> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>Azure.Cosmos.ConflictResolutionPolicy</ReturnType> </ReturnValue> <Docs> <summary> Gets or sets the <see cref="P:Azure.Cosmos.ContainerProperties.ConflictResolutionPolicy" /></summary> <value>To be added.</value> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName="DefaultTimeToLive"> <MemberSignature Language="C#" Value="public int? DefaultTimeToLive { get; set; }" /> <MemberSignature Language="ILAsm" Value=".property instance valuetype System.Nullable`1&lt;int32&gt; DefaultTimeToLive" /> <MemberSignature Language="DocId" Value="P:Azure.Cosmos.ContainerProperties.DefaultTimeToLive" /> <MemberSignature Language="VB.NET" Value="Public Property DefaultTimeToLive As Nullable(Of Integer)" /> <MemberSignature Language="F#" Value="member this.DefaultTimeToLive : Nullable&lt;int&gt; with get, set" Usage="Azure.Cosmos.ContainerProperties.DefaultTimeToLive" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyName>Azure.Cosmos</AssemblyName> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Nullable&lt;System.Int32&gt;</ReturnType> </ReturnValue> <Docs> <summary> Gets the default time to live in seconds for item in a container from the Azure Cosmos service. </summary> <value> It is an optional property. A valid value must be either a nonzero positive timespan or <c>null</c>. By default, DefaultTimeToLive is set to null meaning the time to live is turned off for the container. The unit of measurement is seconds. The maximum allowed value is 2147483647. </value> <remarks> <para> The <see cref="P:Azure.Cosmos.ContainerProperties.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. </para> <para> When the <see cref="P:Azure.Cosmos.ContainerProperties.DefaultTimeToLive" /> is <c>null</c>, the time-to-live will be turned off for the container. It means all the items will never expire. The individual item's time to live will be disregarded. </para> <para> When the <see cref="P:Azure.Cosmos.ContainerProperties.DefaultTimeToLive" /> is '-1', the time-to-live will be turned on for the container. By default, all the items will never expire. The individual item could be given a specific time-to-live value by setting its time to live. The item's time to live will be honored, and the expired items will be deleted in background. </para> <para> When the <see cref="P:Azure.Cosmos.ContainerProperties.DefaultTimeToLive" /> is a nonzero positive integer, the time-to-live will be turned on for the container. And a default time-to-live in seconds will be applied to all the items. A item will be expired after the specified <see cref="P:Azure.Cosmos.ContainerProperties.DefaultTimeToLive" /> value in seconds since its last write time. </para> </remarks> <example> The example below disables time-to-live on a container. <code language="c#"><![CDATA[ container.DefaultTimeToLive = null; ]]></code></example> <example> The example below enables time-to-live on a container. By default, all the items never expire. <code language="c#"><![CDATA[ container.DefaultTimeToLive = TimeSpan.FromDays(2); ]]></code></example> <example> The example below enables time-to-live on a container. By default, the item will expire after 1000 seconds since its last write time. <code language="c#"><![CDATA[ container.DefaultTimeToLive = TimeSpan.FromSeconds(1000); ]]></code></example> </Docs> </Member> <Member MemberName="ETag"> <MemberSignature Language="C#" Value="public Azure.ETag? ETag { get; }" /> <MemberSignature Language="ILAsm" Value=".property instance valuetype System.Nullable`1&lt;valuetype Azure.ETag&gt; ETag" /> <MemberSignature Language="DocId" Value="P:Azure.Cosmos.ContainerProperties.ETag" /> <MemberSignature Language="VB.NET" Value="Public ReadOnly Property ETag As Nullable(Of ETag)" /> <MemberSignature Language="F#" Value="member this.ETag : Nullable&lt;Azure.ETag&gt;" Usage="Azure.Cosmos.ContainerProperties.ETag" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyName>Azure.Cosmos</AssemblyName> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Nullable&lt;Azure.ETag&gt;</ReturnType> </ReturnValue> <Docs> <summary> Gets the entity tag associated with the resource from the Azure Cosmos DB service. </summary> <value> The entity tag associated with the resource. </value> <remarks> ETags are used for concurrency checking when updating resources. </remarks> </Docs> </Member> <Member MemberName="Id"> <MemberSignature Language="C#" Value="public string Id { get; set; }" /> <MemberSignature Language="ILAsm" Value=".property instance string Id" /> <MemberSignature Language="DocId" Value="P:Azure.Cosmos.ContainerProperties.Id" /> <MemberSignature Language="VB.NET" Value="Public Property Id As String" /> <MemberSignature Language="F#" Value="member this.Id : string with get, set" Usage="Azure.Cosmos.ContainerProperties.Id" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyName>Azure.Cosmos</AssemblyName> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.String</ReturnType> </ReturnValue> <Docs> <summary> Gets or sets the Id of the resource in the Azure Cosmos DB service. </summary> <value>The Id associated with the resource.</value> <remarks> <para> Every resource within an Azure Cosmos DB database account needs to have a unique identifier. Unlike <see cref="P:Microsoft.Azure.Documents.Resource.ResourceId" />, which is set internally, this Id is settable by the user and is not immutable. </para> <para> When working with document resources, they too have this settable Id property. If an Id is not supplied by the user the SDK will automatically generate a new GUID and assign its value to this property before persisting the document in the database. You can override this auto Id generation by setting the disableAutomaticIdGeneration parameter on the <see cref="T:Microsoft.Azure.Cosmos.DocumentClient" /> instance to true. This will prevent the SDK from generating new Ids. </para> <para> The following characters are restricted and cannot be used in the Id property: '/', '\\', '?', '#' </para> </remarks> </Docs> </Member> <Member MemberName="IndexingPolicy"> <MemberSignature Language="C#" Value="public Azure.Cosmos.IndexingPolicy IndexingPolicy { get; set; }" /> <MemberSignature Language="ILAsm" Value=".property instance class Azure.Cosmos.IndexingPolicy IndexingPolicy" /> <MemberSignature Language="DocId" Value="P:Azure.Cosmos.ContainerProperties.IndexingPolicy" /> <MemberSignature Language="VB.NET" Value="Public Property IndexingPolicy As IndexingPolicy" /> <MemberSignature Language="F#" Value="member this.IndexingPolicy : Azure.Cosmos.IndexingPolicy with get, set" Usage="Azure.Cosmos.ContainerProperties.IndexingPolicy" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyName>Azure.Cosmos</AssemblyName> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>Azure.Cosmos.IndexingPolicy</ReturnType> </ReturnValue> <Docs> <summary> Gets the <see cref="P:Azure.Cosmos.ContainerProperties.IndexingPolicy" /> associated with the container from the Azure Cosmos DB service. </summary> <value> The indexing policy associated with the container. </value> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName="LastModified"> <MemberSignature Language="C#" Value="public DateTime? LastModified { get; }" /> <MemberSignature Language="ILAsm" Value=".property instance valuetype System.Nullable`1&lt;valuetype System.DateTime&gt; LastModified" /> <MemberSignature Language="DocId" Value="P:Azure.Cosmos.ContainerProperties.LastModified" /> <MemberSignature Language="VB.NET" Value="Public ReadOnly Property LastModified As Nullable(Of DateTime)" /> <MemberSignature Language="F#" Value="member this.LastModified : Nullable&lt;DateTime&gt;" Usage="Azure.Cosmos.ContainerProperties.LastModified" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyName>Azure.Cosmos</AssemblyName> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Nullable&lt;System.DateTime&gt;</ReturnType> </ReturnValue> <Docs> <summary> Gets the last modified time stamp associated with <see cref="T:Azure.Cosmos.ContainerProperties" /> from the Azure Cosmos DB service. </summary> <value>The last modified time stamp associated with the resource.</value> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName="PartitionKeyDefinitionVersion"> <MemberSignature Language="C#" Value="public Azure.Cosmos.PartitionKeyDefinitionVersion? PartitionKeyDefinitionVersion { get; set; }" /> <MemberSignature Language="ILAsm" Value=".property instance valuetype System.Nullable`1&lt;valuetype Azure.Cosmos.PartitionKeyDefinitionVersion&gt; PartitionKeyDefinitionVersion" /> <MemberSignature Language="DocId" Value="P:Azure.Cosmos.ContainerProperties.PartitionKeyDefinitionVersion" /> <MemberSignature Language="VB.NET" Value="Public Property PartitionKeyDefinitionVersion As Nullable(Of PartitionKeyDefinitionVersion)" /> <MemberSignature Language="F#" Value="member this.PartitionKeyDefinitionVersion : Nullable&lt;Azure.Cosmos.PartitionKeyDefinitionVersion&gt; with get, set" Usage="Azure.Cosmos.ContainerProperties.PartitionKeyDefinitionVersion" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyName>Azure.Cosmos</AssemblyName> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.Nullable&lt;Azure.Cosmos.PartitionKeyDefinitionVersion&gt;</ReturnType> </ReturnValue> <Docs> <summary> Gets the Partitioning scheme version used. <see cref="T:Azure.Cosmos.PartitionKeyDefinitionVersion" /></summary> <value>To be added.</value> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName="PartitionKeyPath"> <MemberSignature Language="C#" Value="public string PartitionKeyPath { get; set; }" /> <MemberSignature Language="ILAsm" Value=".property instance string PartitionKeyPath" /> <MemberSignature Language="DocId" Value="P:Azure.Cosmos.ContainerProperties.PartitionKeyPath" /> <MemberSignature Language="VB.NET" Value="Public Property PartitionKeyPath As String" /> <MemberSignature Language="F#" Value="member this.PartitionKeyPath : string with get, set" Usage="Azure.Cosmos.ContainerProperties.PartitionKeyPath" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyName>Azure.Cosmos</AssemblyName> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>System.String</ReturnType> </ReturnValue> <Docs> <summary> JSON path used for containers partitioning </summary> <value>To be added.</value> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName="UniqueKeyPolicy"> <MemberSignature Language="C#" Value="public Azure.Cosmos.UniqueKeyPolicy UniqueKeyPolicy { get; set; }" /> <MemberSignature Language="ILAsm" Value=".property instance class Azure.Cosmos.UniqueKeyPolicy UniqueKeyPolicy" /> <MemberSignature Language="DocId" Value="P:Azure.Cosmos.ContainerProperties.UniqueKeyPolicy" /> <MemberSignature Language="VB.NET" Value="Public Property UniqueKeyPolicy As UniqueKeyPolicy" /> <MemberSignature Language="F#" Value="member this.UniqueKeyPolicy : Azure.Cosmos.UniqueKeyPolicy with get, set" Usage="Azure.Cosmos.ContainerProperties.UniqueKeyPolicy" /> <MemberType>Property</MemberType> <AssemblyInfo> <AssemblyName>Azure.Cosmos</AssemblyName> <AssemblyVersion>4.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>Azure.Cosmos.UniqueKeyPolicy</ReturnType> </ReturnValue> <Docs> <summary> Gets or sets the <see cref="P:Azure.Cosmos.ContainerProperties.UniqueKeyPolicy" /> that guarantees uniqueness of documents in container in the Azure Cosmos DB service. </summary> <value>To be added.</value> <remarks>To be added.</remarks> </Docs> </Member> </Members> </Type>