CBLDocument

@interface CBLDocument : NSObject <CBLDictionary, NSMutableCopying>

A Couchbase Lite document. The CBLDocument is immutable.

  • id

    The document’s ID.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSString *_Nonnull id;
  • The ID representing a document’s revision.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *revisionID;
  • Sequence number of the document in the database. This indicates how recently the document has been changed: every time any document is updated, the database assigns it the next sequential sequence number. Thus, if a document’s sequence property changes that means it’s been changed (on-disk); and if one document’s sequence is greater than another’s, that means it was changed more recently.

    Declaration

    Objective-C

    @property (nonatomic, readonly) uint64_t sequence;
  • The collection that the document belongs to.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) CBLCollection *collection;
  • Returns a mutable copy of the document.

    Declaration

    Objective-C

    - (nonnull CBLMutableDocument *)toMutable;

    Return Value

    The CBLMutableDocument object.

  • Unavailable

    Undocumented

    Declaration

    Objective-C

    - (instancetype) init NS_UNAVAILABLE;
  • Return document data as JSON String.

    Declaration

    Objective-C

    - (nonnull NSString *)toJSON;
  • Internally used for testing purpose.

    Declaration

    Objective-C

    - (nullable NSString *)_getRevisionHistory;