Instance Method
deleteAttachment(dbName:docId:attachmentName:rev:eventLoopGroup:)
Deletes an attachment from a CouchDB document.
func deleteAttachment(dbName: String, docId: String, attachmentName: String, rev: String, eventLoopGroup: (any EventLoopGroup)? = nil) async throws -> CouchUpdateResponse
Parameters
- dbName
The database name.
- docId
The document ID.
- attachmentName
The name of the attachment.
- rev
The current document revision.
- eventLoopGroup
Optional EventLoopGroup for network operations.
Return Value
A CouchUpdateResponse with the new revision.
Discussion
Throws
CouchDBClientError on failure.
Example Usage:
let deleteResponse = try await couchDBClient.deleteAttachment(
dbName: "myDatabase",
docId: "docid",
attachmentName: "image.png",
rev: "currentRev"
)
print("Attachment deleted, new revision: \(deleteResponse.rev)")