DocumentCollection Class

Definition

Represents a document collection in the Azure Cosmos DB database service. A collection is a named logical container for documents.

A database may contain zero or more named collections and each collection consists of zero or more JSON documents. Being schema-free, the documents in a collection do not need to share the same structure or fields. Since collections are application resources, they can be authorized using either the master key or resource keys.

public class DocumentCollection extends Resource
Inheritance
java.lang.Object
DocumentCollection

Inherited Members

Constructors

DocumentCollection()

Initialize a document collection object.

DocumentCollection(String jsonString)

Initialize a document collection object from json string.

Methods

equals(Object obj)
getConflictResolutionPolicy()

Gets the conflictResolutionPolicy that is used for resolving conflicting writes on documents in different regions, in a collection in the Azure Cosmos DB service.

getConflictsLink()

Gets the self-link for conflicts in a collection.

getDefaultTimeToLive()

Gets the collection's default time-to-live value.

getDocumentsLink()

Gets the self-link for documents in a collection.

getIndexingPolicy()

Gets the indexing policy.

getPartitionKey()

Gets the collection's partition key definition.

getStoredProceduresLink()

Gets the self-link for stored procedures in a collection.

getTriggersLink()

Gets the self-link for triggers in a collection.

getUniqueKeyPolicy()

Sets the Uni that guarantees uniqueness of documents in collection in the Azure Cosmos DB service.

getUserDefinedFunctionsLink()

Gets the self-link for user defined functions in a collection.

hashCode()
setConflictResolutionPolicy(ConflictResolutionPolicy value)

Sets the conflictResolutionPolicy that is used for resolving conflicting writes on documents in different regions, in a collection in the Azure Cosmos DB service.

setDefaultTimeToLive(Integer timeToLive)

Sets the collection's default time-to-live value.

The default time-to-live value on a collection is an optional property. If set, the documents within the collection expires after the specified number of seconds since their last write time. The value of this property should be one of the following:

null - indicates evaluation of time-to-live is disabled and documents within the collection will never expire, regardless whether individual documents have their time-to-live set.

nonzero positive integer - indicates the default time-to-live value for all documents within the collection. This value can be overridden by individual documents' time-to-live value.

-1 - indicates by default all documents within the collection never expire. This value can be overridden by individual documents' time-to-live value.

setIndexingPolicy(IndexingPolicy indexingPolicy)

Sets the indexing policy.

setPartitionKey(PartitionKeyDefinition partitionKey)

Sets the collection's partition key definition.

setUniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy)

Applies to