incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bsquared <bwcod...@gmail.com>
Subject Re: how to delete document with empty _id
Date Tue, 27 Sep 2011 18:13:48 GMT
Thanks for the reply.  I tried the code indicated and couchdb returned
an error.

curl -X DELETE
http://localhost:5984/dbname/?rev=1-8ba22720ecb6577f1c7284d43b182643
{"error":"bad_request","reason":"You tried to DELETE a database with a
?=rev parameter. Did you mean to DELETE a document instead?"}

BTW: It is possible to create a document where _id = "" using an upadte
handler.
I no longer have the code, but I set some fields in the doc parameter
and did not set the _id.  I called the update handler using curl without
a document path and here is the result:

curl -X GET http://localhost:5984/dbname/_design/backend/_view/vw_invalid
{"total_rows":1,"offset":0,"rows":[
{"id":"","key":"1-8ba22720ecb6577f1c7284d43b182643",
"value":{"_id":"","_rev":"1-8ba22720ecb6577f1c7284d43b182643",
"create_date":"2011-09-24T20:42:51.986Z",
"last_change_date":"2011-09-24T20:42:51.986Z"}}


-- 
Regards,
Brian Winfrey


Mime
View raw message