Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CouchRest to delete document from couchdb

Tags:

couchdb

How can I delete a document from couchdb using CouchRest, I have the document id. I guess it is something simple I am missing here.

I tried -

    CouchRest.delete("http://localhost:5984/db/docid") 

It throws an RestClient::ResourceNotFound: 404 Resource Not Found:

Could anybody throw some light on this issue please.

Cheers

like image 437
verdure Avatar asked Mar 01 '26 22:03

verdure


2 Answers

You cannot delete a document without knowing its _rev.

like image 127
Marcello Nuccio Avatar answered Mar 04 '26 10:03

Marcello Nuccio


I don't use CouchRest, but according to your code, you may append a _rev query parameter like this:

CouchRest.delete("http://localhost:5984/db/docid?_rev=docrev")
like image 22
ahmedyha Avatar answered Mar 04 '26 12:03

ahmedyha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!