Document Class

Definition

Represents a document in the Azure Cosmos DB database service.

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.

public class Document extends Resource
Inheritance
java.lang.Object
Serializable
Document

Inherited Members

Constructors

Document()

Initialize a document object.

Document(JSONObject jsonObject)

Initialize a document object from json object.

Document(String jsonString)

Initialize a document object from json string.

Document(String jsonString, ObjectMapper objectMapper)

Initialize a document object from json string.

Methods

getTimeToLive()

Gets the document's time-to-live value.

setTimeToLive(Integer timeToLive)

Sets the document's time-to-live value.

A document's time-to-live value is an optional property. If set, the document expires after the specified number of seconds since its last write time. The value of this property should be one of the following:

null - indicates the time-to-live value for this document inherits from the parent collection's default time-to-live value.

nonzero positive integer - indicates the number of seconds before the document expires. It overrides the default time-to-live value specified on the parent collection, unless the parent collection's default time-to-live is null.

-1 - indicates the document never expires. It overrides the default time-to-live value specified on the parent collection, unless the parent collection's default time-to-live is null.

Applies to