March 9th, 2017
3:29 pm
Deleting Attachments in CouchDB via Fauxton

Posted under CouchDB
Tags ,

There is no specific feature for doing this in Fauxton – you can upload attachments but not specifically delete them.

You can delete the attachment programmatically by issuing an HTTP DELETE to the attachment’s URL

This post here states that removing the stub reference to the attachment in “_attachments” in the document actually does the same as deleting programmatically as above.

In both cases, the stub is deleted, and the actual attachment is marked for delete. It will only actually be deleted when the database is compacted. However, the important point is that both methods apparently do the same thing.

Therefore, in Fauxton, you can just edit the JSON for the document to remove the attachment stub, and save the change.

No Comments »