Permalink
Fetching contributors…
Cannot retrieve contributors at this time
422 lines (422 sloc) 22.1 KB
<Type Name="Document" FullName="Microsoft.Azure.Documents.Document">
<TypeSignature Language="C#" Value="public class Document : Microsoft.Azure.Documents.Resource, System.Dynamic.IDynamicMetaObjectProvider" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Document extends Microsoft.Azure.Documents.Resource implements class System.Dynamic.IDynamicMetaObjectProvider" />
<TypeSignature Language="DocId" Value="T:Microsoft.Azure.Documents.Document" />
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>Microsoft.Azure.Documents.Resource</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.Dynamic.IDynamicMetaObjectProvider</InterfaceName>
</Interface>
</Interfaces>
<Docs>
<summary>
Represents a document in the Azure DocumentDB database service.
</summary>
<remarks>
A document is a structured JSON document. There is no set schema for the JSON documents, and a document may contain any
number of custom properties as well as an optional list of attachments. Document is an application resource and can be
authorized using the master key or resource keys.
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public Document ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Azure.Documents.Document.#ctor" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>
Initializes a new instance of the <see cref="T:Microsoft.Azure.Documents.Document" /> class for the Azure DocumentDB database service.
</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="AttachmentsLink">
<MemberSignature Language="C#" Value="public string AttachmentsLink { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string AttachmentsLink" />
<MemberSignature Language="DocId" Value="P:Microsoft.Azure.Documents.Document.AttachmentsLink" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>
Gets the self-link corresponding to attachments of the document from the Azure DocumentDB database service.
</summary>
<value>
The self-link corresponding to attachments of the document.
</value>
<remarks>
Every document can have between zero and many attachments. The attachments link contains a feed of attachments that belong to
the document.
</remarks>
</Docs>
</Member>
<Member MemberName="System.Dynamic.IDynamicMetaObjectProvider.GetMetaObject">
<MemberSignature Language="C#" Value="System.Dynamic.DynamicMetaObject IDynamicMetaObjectProvider.GetMetaObject (System.Linq.Expressions.Expression parameter);" />
<MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance class System.Dynamic.DynamicMetaObject System.Dynamic.IDynamicMetaObjectProvider.GetMetaObject(class System.Linq.Expressions.Expression parameter) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Azure.Documents.Document.System#Dynamic#IDynamicMetaObjectProvider#GetMetaObject(System.Linq.Expressions.Expression)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Dynamic.DynamicMetaObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="parameter" Type="System.Linq.Expressions.Expression" />
</Parameters>
<Docs>
<param name="parameter">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="TimeToLive">
<MemberSignature Language="C#" Value="public Nullable&lt;int&gt; TimeToLive { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Nullable`1&lt;int32&gt; TimeToLive" />
<MemberSignature Language="DocId" Value="P:Microsoft.Azure.Documents.Document.TimeToLive" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.DocumentDB.Core</AssemblyName>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>Newtonsoft.Json.JsonProperty(NullValueHandling=Newtonsoft.Json.NullValueHandling.Ignore, PropertyName="ttl")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Int32&gt;</ReturnType>
</ReturnValue>
<Docs>
<summary>
Gets or sets the time to live in seconds of the document in the Azure DocumentDB database service.
</summary>
<value>
It is an optional property.
A valid value must be either a nonzero positive integer, '-1', or <c>null</c>.
By default, TimeToLive is set to null meaning the document inherits the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" />.
The unit of measurement is seconds. The maximum allowed value is 2147483647.
When the value is '-1', it means never expire regardless of the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" /> value.
</value>
<remarks>
<para>
The final time-to-live policy of a document is evaluated after consulting the collection's
<see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" />.
</para>
<para>
When the <see cref="P:Microsoft.Azure.Documents.Document.TimeToLive" /> is <c>null</c>, the document inherits the collection's
<see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" />.
If the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" /> is a nonzero positive integer,
then the document will inherit that value as its time-to-live in seconds, and will be expired
after the default time-to-live in seconds since its last write time. The expired documents will be deleted in background.
Otherwise, the document will never expire.
</para>
<para>
When the <see cref="P:Microsoft.Azure.Documents.Document.TimeToLive" /> is '-1', the document will never expire regardless of the collection's
<see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" /> value.
</para>
<para>
When the <see cref="P:Microsoft.Azure.Documents.Document.TimeToLive" /> is a nonzero positive integer, need to check the collection's
<see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" />.
If the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" /> is <c>null</c>, which means the time-to-live
has been turned off on the collection, and the document's <see cref="P:Microsoft.Azure.Documents.Document.TimeToLive" /> should be disregarded and the document
will never expire.
Otherwise, the document's <see cref="P:Microsoft.Azure.Documents.Document.TimeToLive" /> will be honored. The document will be expired
after the default time-to-live in seconds since its last write time. The expired documents will be deleted in background.
</para>
<para>
The table below shows an example of the matrix to evaluate the final time-to-live policy given a collection's
<see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" /> and a document's <see cref="P:Microsoft.Azure.Documents.Document.TimeToLive" />.
</para>
<list type="table">
<listheader>
<term>Collection</term>
<description>Matrix</description>
</listheader>
<item>
<term>DefaultTimeToLive = null</term>
<description>
<list type="table">
<listheader>
<term>Document</term>
<description>Result</description>
</listheader>
<item>
<term>TimeToLive = null</term>
<description>TTL is disabled. The document will never expire (default).</description>
</item>
<item>
<term>TimeToLive = -1</term>
<description>TTL is disabled. The document will never expire.</description>
</item>
<item>
<term>TimeToLive = 2000</term>
<description>TTL is disabled. The document will never expire.</description>
</item>
</list>
</description>
</item>
<item>
<term>DefaultTimeToLive = -1</term>
<description>
<list type="table">
<listheader>
<term>Document</term>
<description>Result</description>
</listheader>
<item>
<term>TimeToLive = null</term>
<description>TTL is enabled. The document will never expire (default).</description>
</item>
<item>
<term>TimeToLive = -1</term>
<description>TTL is enabled. The document will never expire.</description>
</item>
<item>
<term>TimeToLive = 2000</term>
<description>TTL is enabled. The document will expire after 2000 seconds.</description>
</item>
</list>
</description>
</item>
<item>
<term>DefaultTimeToLive = 1000</term>
<description>
<list type="table">
<listheader>
<term>Document</term>
<description>Result</description>
</listheader>
<item>
<term>TimeToLive = null</term>
<description>TTL is enabled. The document will expire after 1000 seconds (default).</description>
</item>
<item>
<term>TimeToLive = -1</term>
<description>TTL is enabled. The document will never expire.</description>
</item>
<item>
<term>TimeToLive = 2000</term>
<description>TTL is enabled. The document will expire after 2000 seconds.</description>
</item>
</list>
</description>
</item>
</list>
</remarks>
<example>
The example below removes 'ttl' from document content.
The document will inherit the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" /> as its time-to-live value.
<code language="c#"><![CDATA[
document.TimeToLive = null;
]]></code></example>
<example>
The example below ensures that the document should never expire regardless.
<code language="c#"><![CDATA[
document.TimeToLive = -1;
]]></code></example>
<example>
The example below sets the time-to-live in seconds on a document.
The document will expire after 1000 seconds since its last write time when the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" />
is not <c>null</c>.
<code language="c#"><![CDATA[
document.TimeToLive = 1000;
]]></code></example>
<altmember cref="T:Microsoft.Azure.Documents.DocumentCollection" />
<example>
The example below removes 'ttl' from document content.
The document will inherit the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" /> as its time-to-live value.
<code language="c#"><![CDATA[
document.TimeToLive = null;
]]></code></example>
<example>
The example below ensures that the document should never expire regardless.
<code language="c#"><![CDATA[
document.TimeToLive = -1;
]]></code></example>
<example>
The example below sets the time-to-live in seconds on a document.
The document will expire after 1000 seconds since its last write time when the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" />
is not <c>null</c>.
<code language="c#"><![CDATA[
document.TimeToLive = 1000;
]]></code></example>
<example>
The example below removes 'ttl' from document content.
The document will inherit the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" /> as its time-to-live value.
<code language="c#"><![CDATA[
document.TimeToLive = null;
]]></code></example>
<example>
The example below ensures that the document should never expire regardless.
<code language="c#"><![CDATA[
document.TimeToLive = -1;
]]></code></example>
<example>
The example below sets the time-to-live in seconds on a document.
The document will expire after 1000 seconds since its last write time when the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" />
is not <c>null</c>.
<code language="c#"><![CDATA[
document.TimeToLive = 1000;
]]></code></example>
<example>
The example below removes 'ttl' from document content.
The document will inherit the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" /> as its time-to-live value.
<code language="c#"><![CDATA[
document.TimeToLive = null;
]]></code></example>
<example>
The example below ensures that the document should never expire regardless.
<code language="c#"><![CDATA[
document.TimeToLive = -1;
]]></code></example>
<example>
The example below sets the time-to-live in seconds on a document.
The document will expire after 1000 seconds since its last write time when the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" />
is not <c>null</c>.
<code language="c#"><![CDATA[
document.TimeToLive = 1000;
]]></code></example>
<example>
The example below removes 'ttl' from document content.
The document will inherit the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" /> as its time-to-live value.
<code language="c#"><![CDATA[
document.TimeToLive = null;
]]></code></example>
<example>
The example below ensures that the document should never expire regardless.
<code language="c#"><![CDATA[
document.TimeToLive = -1;
]]></code></example>
<example>
The example below sets the time-to-live in seconds on a document.
The document will expire after 1000 seconds since its last write time when the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" />
is not <c>null</c>.
<code language="c#"><![CDATA[
document.TimeToLive = 1000;
]]></code></example>
<example>
The example below removes 'ttl' from document content.
The document will inherit the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" /> as its time-to-live value.
<code language="c#"><![CDATA[
document.TimeToLive = null;
]]></code></example>
<example>
The example below ensures that the document should never expire regardless.
<code language="c#"><![CDATA[
document.TimeToLive = -1;
]]></code></example>
<example>
The example below sets the time-to-live in seconds on a document.
The document will expire after 1000 seconds since its last write time when the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" />
is not <c>null</c>.
<code language="c#"><![CDATA[
document.TimeToLive = 1000;
]]></code></example>
<example>
The example below removes 'ttl' from document content.
The document will inherit the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" /> as its time-to-live value.
<code language="c#"><![CDATA[
document.TimeToLive = null;
]]></code></example>
<example>
The example below ensures that the document should never expire regardless.
<code language="c#"><![CDATA[
document.TimeToLive = -1;
]]></code></example>
<example>
The example below sets the time-to-live in seconds on a document.
The document will expire after 1000 seconds since its last write time when the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" />
is not <c>null</c>.
<code language="c#"><![CDATA[
document.TimeToLive = 1000;
]]></code></example>
<example>
The example below removes 'ttl' from document content.
The document will inherit the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" /> as its time-to-live value.
<code language="c#"><![CDATA[
document.TimeToLive = null;
]]></code></example>
<example>
The example below ensures that the document should never expire regardless.
<code language="c#"><![CDATA[
document.TimeToLive = -1;
]]></code></example>
<example>
The example below sets the time-to-live in seconds on a document.
The document will expire after 1000 seconds since its last write time when the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" />
is not <c>null</c>.
<code language="c#"><![CDATA[
document.TimeToLive = 1000;
]]></code></example>
<example>
The example below removes 'ttl' from document content.
The document will inherit the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" /> as its time-to-live value.
<code language="c#"><![CDATA[
document.TimeToLive = null;
]]></code></example>
<example>
The example below ensures that the document should never expire regardless.
<code language="c#"><![CDATA[
document.TimeToLive = -1;
]]></code></example>
<example>
The example below sets the time-to-live in seconds on a document.
The document will expire after 1000 seconds since its last write time when the collection's <see cref="P:Microsoft.Azure.Documents.DocumentCollection.DefaultTimeToLive" />
is not <c>null</c>.
<code language="c#"><![CDATA[
document.TimeToLive = 1000;
]]></code></example>
</Docs>
</Member>
</Members>
</Type>