Code updating from Couchbase Lite 1.x to 3.x in iOS

What will be the equivalent of below code in Couchbase Lite 3.x ?

Below is the Objective C Couchbase Lite 1.x code

1)

CBLDocument *doc = [self getDocumentWithKey:documentID];
CBLUnsavedRevision *unsavedRev = [doc.currentRevision createRevision];
[unsavedRev removeAttachmentNamed: attachmentName];
NSError* error;
[unsavedRev save: &error];

2)

CBLDocument *document = [database createDocument];
NSError *error = nil;

if (![document putProperties:fnaForm error:&error]) {
    NSLog(@“Error: %@", error.localizedDescription);
} else {
    CBLUnsavedRevision *newRev = document.currentRevision.createRevision;
    UIImage *image = [UIImage imageWithData:form.source];
    NSData *imageData = UIImageJPEGRepresentation(image, 1);
    [newRev setAttachmentNamed:@"content.jpg" withContentType:@"image/jpeg" content:imageData];
    
    error = nil;
    [newRev save:&error];
}

See the Blobs section of the documentation for info on how to do this.