Share via


ContainerProperties.AnalyticalStoreTimeToLiveInSeconds Property

Definition

Gets or sets the time to live for analytical store in seconds at container scope for the Azure Cosmos service.

Analytical store when enabled captures all the item changes in the container. AnalyticalStoreTimeToLiveInSeconds defines the time to live for the changes in analytical store.

[Newtonsoft.Json.JsonProperty(NullValueHandling=Newtonsoft.Json.NullValueHandling.Ignore, PropertyName="analyticalStorageTtl")]
public int? AnalyticalStoreTimeToLiveInSeconds { get; set; }
[<Newtonsoft.Json.JsonProperty(NullValueHandling=Newtonsoft.Json.NullValueHandling.Ignore, PropertyName="analyticalStorageTtl")>]
member this.AnalyticalStoreTimeToLiveInSeconds : Nullable<int> with get, set
Public Property AnalyticalStoreTimeToLiveInSeconds As Nullable(Of Integer)

Property Value

It is an optional property.

The unit of measurement is seconds. The maximum allowed value is 2147483647. When updating this property, a valid value must be either a positive integer or '-1'.

By default, AnalyticalStoreTimeToLiveInSeconds is null meaning analytical store is turned-off.

Attributes
Newtonsoft.Json.JsonPropertyAttribute

Examples

The example below disables analytical store on a container if previously enabled.

container.AnalyticalStoreTimeToLiveInSeconds = 0;

The example below enables analytical store on container capturing all changes and never expire.

container.AnalyticalStoreTimeToLiveInSeconds = -1;

The example below enables analytical store on container capturing all changes and expire after 180days.

container.AnalyticalStoreTimeToLiveInSeconds = (int)TimeSpan.FromDays(6 * 30).TotalSeconds;

Remarks

The AnalyticalStoreTimeToLiveInSeconds is applicable to all the item changes in the container. It cannot be overriden or customizable per item.

When the AnalyticalStoreTimeToLiveInSeconds is 0 analytical store is turned-off. It means all the item changes in the container are disregarded.

When the AnalyticalStoreTimeToLiveInSeconds is '-1', all the items changes will be captured by analytical store and will never expire.

When the AnalyticalStoreTimeToLiveInSeconds is a nonzero positive integer, all the items changes will be captured by analytical store and expired after the specified time to live.

Applies to