/** * Remove an Attachment from a Document * * @param docId * @param attachName */ public void deleteAttachment(String docId, String attachName) { try { Document doc = database.getDocument(docId); UnsavedRevision newRev = doc.getCurrentRevision().createRevision(); newRev.removeAttachment(attachName); // (You could also update newRev.properties while you're here) newRev.save(); } catch (CouchbaseLiteException e) { e.printStackTrace(); } }
@Kroll.method public void removeAttachment(String name) { ((UnsavedRevision) revision).removeAttachment(name); // TODO attachment cache }