Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DELETE for attachments #1291

Open
DiegoJArg opened this issue Aug 3, 2020 · 0 comments
Open

DELETE for attachments #1291

DiegoJArg opened this issue Aug 3, 2020 · 0 comments

Comments

@DiegoJArg
Copy link

While starting to discover CouchDB and Fauxton, it is easy to add attachments, but an attempt to delete them seem to not be as easy as expected.
I don't really know what is happening and the error message doesn't really shows much.

Expected Behavior

Click somewhere in Fauxton to delete the attachment.

Current Behavior

curl -X DELETE http://admin:secret@localhost:5984/couchproducts/_design%2Fcouchproducts/myfile.zip
{"error":"conflict","reason":"Document update conflict."}

curl -X GET http://admin:secret@localhost:5984/couchproducts/_design%2Fcouchproducts/myfile.zip?revs_info=true
Returns nothing

"_attachments": {
    "myfile.zip": {
      "content_type": "application/zip",
      "revpos": 4,
      "digest": "md5-AiwXFik75/GtK89+z/7ItQ==",
      "length": 46892239,
      "stub": true
    },

Possible Solution

Feature to list attached files and be able to delete them.

Steps to Reproduce (for bugs)

  1. Create a document
  2. Attach a big file
  3. Watch how this expand the size of the database
  4. Try to delete it to reduce the size of the database

Context

I was trying to learn more from CouchDB as a beginner.
The attempt was to check if attachments were stored as files or documents, or inside the database as blobs.
It turns out that they are stored as blobs.
Now I want to delete it and while Fauxton doesn't have the tool to do it, it is rejected by curl.

Your Environment

  • Version used: CouchDB 3.1.0
  • Browser Name and version: Chrome 84
  • Operating System and version (desktop or mobile): macOS 10.15.5
  • Link to your project:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant