Click or drag to resize

Document Class

A Couchbase Lite Document.
Inheritance Hierarchy
SystemObject
  Couchbase.LiteDocument

Namespace:  Couchbase.Lite
Assembly:  Couchbase.Lite (in Couchbase.Lite.dll) Version: 1.4.1-b107
Syntax
C#
public sealed class Document

The Document type exposes the following members.

Constructors
  NameDescription
Public methodDocument Obsolete.
Constructor
Top
Properties
  NameDescription
Public propertyConflictingRevisions
Gets all of the current conflicting Revisions for the Document. If the Document is not in conflict, only the single current Revision will be returned.
Public propertyCurrentRevision
Gets the current/latest Revision.
Public propertyCurrentRevisionId
If known, gets the Id of the current Revision, otherwise null.
Public propertyDatabase
Gets the Database that owns this Document.
Public propertyDeleted
Gets if the Document is deleted.
Public propertyId
Gets the Document's id.
Public propertyLeafRevisions
Gets all of the leaf Revisions in the Document's Revision tree.
Public propertyProperties
Gets the properties of the current Revision of the Document.
Public propertyRevisionHistory
Gets the Document's Revision history in forward order. Older, ancestor, Revisions are not guaranteed to have their properties available.
Public propertyUserProperties
Gets the properties of the current Revision of the Document without any properties with keys prefixed with '_' (which contain Couchbase Lite data).
Top
Methods
  NameDescription
Public methodCreateRevision
Creates a new UnsavedRevision whose properties and attachments are initially identical to the current Revision.
Public methodDelete
Deletes the Document.
Public methodExpireAfter
Sets an interval to wait before expiring the document.
Public methodExpireAt
Sets an absolute point in time for the document to expire. Must be a DateTime in the future. Pass a null value to cancel an expiration.
Public methodGetExpirationDate
Gets the expiration data of this document, if it has one
Public methodGetProperty(String)
Returns the value of the property with the specified key.
Public methodGetPropertyTValue(String)
Returns the TValue of the property with the specified key.
Public methodGetRevision
Returns the Revision with the specified id if it exists, otherwise null.
Public methodPurge
Completely purges the Document from the local Database. This is different from delete in that it completely deletes everything related to the Document and does not replicate the deletes to other Databases.
Public methodPutExistingRevision
Adds an existing revision copied from another database. Unlike a normal insertion, this does not assign a new revision ID; instead the revision's ID must be given. Ths revision's history (ancestry) must be given, which can put it anywhere in the revision tree. It's not an error if the revision already exists locally; it will just be ignored. This is not an operation that clients normall perform; it's used by the replicator. You might want to use it if you're pre-loading a database with canned content, or if you're implementing some new kind of replicator that transfers revisions from another database
Public methodPutProperties
Creates and saves a new Revision with the specified properties. To succeed the specified properties must include a '_rev' property whose value maches the current Revision's id.
Public methodUpdate
Creates and saves a new Revision by allowing the caller to update the existing properties. Conflicts are handled by calling the delegate again.
Top
Events
  NameDescription
Public eventChange
Adds or Removed a change delegate that will be called whenever the Document changes
Top
See Also