couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nils Breunese <>
Subject RE: delete Docs
Date Mon, 05 Apr 2010 12:23:34 GMT
You don't need to GET the full document to retrieve the current revision. You can just do a
HEAD request and look at the Etag header, which contains the document _rev.

$ curl --head
HTTP/1.1 200 OK
Date: Mon, 05 Apr 2010 12:26:39 GMT
Server: CouchDB/0.10.1 (Erlang OTP/R13B)
Etag: "86-ff15272d40894c8d7ece25891a874230"

I usually work with a CouchDB library which abstracts this away (I like couchdb-python for
scripting), but I guess they all use HEAD requests under the hood.

Nils Breunese.
Van: Fred Lemasson []
Verzonden: maandag 5 april 2010 14:14
Onderwerp: delete Docs

I everyone

I could use some advice on CouchDB "Best Pratice" for deleting documents.

Lets say I know the id of some docs I want to delete, I still have to
retreive their _rev number before sending the DELETE. So, do I really
have to read(GET request) an entire document just to get its _rev or
should I create a _view to get _id + _rev pairs ?
Both ways seem non ideal to me, because why loading an entire document
just to read its _rev (it might be a really big doc and u might have a
lot of them) and why create a _view that will suffer from indexation
process, reading a single value is supposed to be quick ...
Or may be there is a way to get "just" the _rev from some doc _id that
I don't know about ?

Feel free to show me the way ... and let me know how u proceed ...


De informatie vervat in deze  e-mail en meegezonden bijlagen is uitsluitend bedoeld voor gebruik
door de geadresseerde en kan vertrouwelijke informatie bevatten. Openbaarmaking, vermenigvuldiging,
verspreiding en/of verstrekking van deze informatie aan derden is voorbehouden aan geadresseerde.
De VPRO staat niet in voor de juiste en volledige overbrenging van de inhoud van een verzonden
e-mail, noch voor tijdige ontvangst daarvan.

View raw message