{"id":1915,"date":"2017-03-09T15:29:40","date_gmt":"2017-03-09T15:29:40","guid":{"rendered":"http:\/\/salientsoft.co.uk\/?p=1915"},"modified":"2018-10-10T17:15:57","modified_gmt":"2018-10-10T17:15:57","slug":"deleting-attachments-in-couchdb-via-fauxton","status":"publish","type":"post","link":"https:\/\/salientsoft.co.uk\/?p=1915","title":{"rendered":"Deleting Attachments in CouchDB via Fauxton"},"content":{"rendered":"<p>There is no specific feature for doing this in Fauxton \u2013 you can upload attachments but not specifically delete them.<\/p>\n<p>You can delete the attachment programmatically by issuing an HTTP DELETE to the attachment\u2019s URL<\/p>\n<p><a href=\"http:\/\/stackoverflow.com\/questions\/2750232\/deleting-document-attachments-in-couchdb\">This post here<\/a> states that removing the stub reference to the attachment in \u201c_attachments\u201d in the document actually does the same as deleting programmatically as above.<\/p>\n<p>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.<\/p>\n<p>Therefore, in Fauxton, you can just edit the JSON for the document to remove the attachment stub, and save the change.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is no specific feature for doing this in Fauxton \u2013 you can upload attachments but not specifically delete them. You can delete the attachment programmatically by issuing an HTTP DELETE to the attachment\u2019s URL This post here states that removing the stub reference to the attachment in \u201c_attachments\u201d in the document actually does the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[197],"tags":[203,16],"_links":{"self":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1915"}],"collection":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1915"}],"version-history":[{"count":1,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1915\/revisions"}],"predecessor-version":[{"id":1916,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1915\/revisions\/1916"}],"wp:attachment":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}