Couchbase Lite
Objective-C API for iOS and Mac OS
CBLRevision Class Reference

Detailed Description

A revision of a CBLDocument.

This is the abstract base class of CBLSavedRevision (existing revisions) and CBLNewRevision (revisions yet to be saved).

Inheritance diagram for CBLRevision:
CBLSavedRevision CBLUnsavedRevision

Instance Methods

(nullable CBLArrayOf(CBLRevision *) - getRevisionHistory:
 Returns the ancestry of this revision as an array of CBLRevisions, in chronological order. More...
 
(nullable id) - propertyForKey:
 Shorthand for [self.properties objectForKey: key]. More...
 
(nullable id) - objectForKeyedSubscript:
 Same as -propertyForKey:. More...
 
() - CBLArrayOf
 The names of all attachments (an array of strings). More...
 
(nullable CBLAttachment *) - attachmentNamed:
 Looks up the attachment with the given name (without fetching its contents yet). More...
 
() - CBLArrayOf
 All attachments, as CBLAttachment objects. More...
 
(instancetype) - NS_UNAVAILABLE
 

Properties

CBLDocumentdocument
 The document this is a revision of. More...
 
CBLDatabasedatabase
 The database this revision's document belongs to. More...
 
BOOL isDeletion
 Does this revision mark the deletion of its document? (In other words, does it have a "_deleted" property?) More...
 
BOOL isGone
 Does this revision mark the deletion or removal (from available channels) of its document ? (In other words, does it have a "_deleted_ or "_removed" property?) More...
 
NSString * revisionID
 The ID of this revision. More...
 
CBLSavedRevisionparentRevision
 The revision this one is a child of. More...
 
NSString * parentRevisionID
 The ID of the parentRevision. More...
 
CBLJSONDict * properties
 The revision's contents as parsed from JSON. More...
 
CBLJSONDict * userProperties
 The user-defined properties, without the ones reserved by CouchbaseLite. More...
 

Method Documentation

◆ getRevisionHistory:()

- (nullable CBLArrayOf(CBLRevision*) getRevisionHistory: (NSError **)  outError

Returns the ancestry of this revision as an array of CBLRevisions, in chronological order.

Older revisions are NOT guaranteed to have their properties available.

◆ propertyForKey:()

- (nullable id) propertyForKey: (NSString *)  key

Shorthand for [self.properties objectForKey: key].

◆ objectForKeyedSubscript:()

- (nullable id) objectForKeyedSubscript: (NSString *)  key

Same as -propertyForKey:.

Enables "[]" access in Xcode 4.4+

◆ CBLArrayOf() [1/2]

- CBLArrayOf (NSString *) 

The names of all attachments (an array of strings).

◆ attachmentNamed:()

- (nullable CBLAttachment*) attachmentNamed: (NSString *)  name

Looks up the attachment with the given name (without fetching its contents yet).

◆ CBLArrayOf() [2/2]

- CBLArrayOf (CBLAttachment *) 

All attachments, as CBLAttachment objects.

◆ NS_UNAVAILABLE()

- (instancetype) NS_UNAVAILABLE

Property Documentation

◆ document

- (CBLDocument*) document
readatomicweak

The document this is a revision of.

◆ database

- (CBLDatabase*) database
readatomicassign

The database this revision's document belongs to.

◆ isDeletion

- (BOOL) isDeletion
readatomicassign

Does this revision mark the deletion of its document? (In other words, does it have a "_deleted" property?)

◆ isGone

- (BOOL) isGone
readatomicassign

Does this revision mark the deletion or removal (from available channels) of its document ? (In other words, does it have a "_deleted_ or "_removed" property?)

◆ revisionID

- (NSString*) revisionID
readatomicassign

The ID of this revision.

Will be nil if this is a CBLUnsavedRevision.

◆ parentRevision

- (CBLSavedRevision*) parentRevision
readatomicassign

The revision this one is a child of.

◆ parentRevisionID

- (NSString*) parentRevisionID
readatomicassign

The ID of the parentRevision.

◆ properties

- (CBLJSONDict*) properties
readatomicassign

The revision's contents as parsed from JSON.

Keys beginning with "_" are defined and reserved by CouchbaseLite; others are app-specific. The first call to this method may need to fetch the properties from disk, but subsequent calls are very cheap.

◆ userProperties

- (CBLJSONDict*) userProperties
readatomiccopy

The user-defined properties, without the ones reserved by CouchbaseLite.

This is based on -properties, with every key whose name starts with "_" removed.


The documentation for this class was generated from the following file: