예제 #1
0
  /**
   * 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();
    }
  }
예제 #2
0
 @Kroll.method
 public void removeAttachment(String name) {
   ((UnsavedRevision) revision).removeAttachment(name);
   // TODO attachment cache
 }