CBLMutableDocument

@interface CBLMutableDocument : CBLDocument <CBLMutableDictionary>

The mutable version of the CBLDocument.

  • Creates a new CBLMutableDocument object with a new random UUID. The created document will be saved into a database when you call the CBLDatabase’s -save: method with the document object given.

    Declaration

    Objective-C

    + (nonnull instancetype)document;
  • Creates a new CBLMutableDocument object with the given ID. If a nil ID value is given, the document will be created with a new random UUID. The created document will be saved into a database when you call the CBLDatabase’s -save: method with the document object given.

    Declaration

    Objective-C

    + (nonnull instancetype)documentWithID:(nullable NSString *)documentID;

    Parameters

    documentID

    The document ID.

  • Initializes a new CBLMutableDocument object with a new random UUID. The created document will be saved into a database when you call the CBLDatabase’s -save: method with the document object given.

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Swift

    init()
  • Initializes a new CBLMutableDocument object with the given ID. If a nil ID value is given, the document will be created with a new random UUID. The created document will be saved into a database when you call the CBLDatabase’s -save: method with the document object given.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithID:(nullable NSString *)documentID;

    Swift

    init(id documentID: String?)

    Parameters

    documentID

    The document ID.

  • Initializes a new CBLMutableDocument object with a new random UUID and the data. Allowed data value types are CBLArray, CBLBlob, CBLDictionary, NSArray, NSDate, NSDictionary, NSNumber, NSNull, NSString. The NSArrays and NSDictionaries must contain only the above types. The created document will be saved into a database when you call the CBLDatabase’s -save: method with the document object given.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithData:
        (nullable NSDictionary<NSString *, id> *)data;

    Swift

    init(data: [String : Any]?)

    Parameters

    data

    The data.

  • Initializes a new CBLMutableDocument object with the given ID and the data. If a nil ID value is given, the document will be created with a new random UUID. Allowed data value types are CBLMutableArray, CBLBlob, CBLMutableDictionary, NSArray, NSDate, NSDictionary, NSNumber, NSNull, NSString. The NSArrays and NSDictionaries must contain only the above types. The created document will be saved into a database when you call the CBLDatabase’s -save: method with the document object given.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithID:(nullable NSString *)documentID
                                  data:
                                      (nullable NSDictionary<NSString *, id> *)data;

    Swift

    init(id documentID: String?, data: [String : Any]?)

    Parameters

    documentID

    The document ID.

    data

    The data.