couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Candler <>
Subject Re: Where to add documentation for bulk updates
Date Mon, 23 Mar 2009 17:40:55 GMT
On Mon, Mar 23, 2009 at 09:59:56AM -0700, David Van Couvering wrote:
>    OK, thanks, I didn't read down far enough.  I fixed the conflict and
>    made some more updates to make the overall section more clean and
>    consistent, and added some more meat to the examples.

Cheers. Could you also fix the all-or-nothing documentation while you're at
it. Experimentation suggests it doesn't work if you add ?all_or_nothing=true
or ?all-or-nothing=true to the URL; rather you need to put
{"all_or_nothing":true} as part of the POSTed JSON.


$ curl http://localhost:5984/
$ DB=""
$ curl -X PUT "$DB"
$ curl -X PUT -d '{"name":"fred"}' "$DB/person"
$ curl -X POST -d '{"docs":[{"_id":"person","_rev":"1-877727288","name":"jim"}]}' "$DB/_bulk_docs?all_or_nothing=true"
$ curl -X POST -d '{"docs":[{"_id":"person","_rev":"1-877727288","name":"trunky"}]}' "$DB/_bulk_docs?all_or_nothing=true"
[{"id":"person","error":"conflict","reason":"Document update conflict."}]
$ curl -X POST -d '{"docs":[{"_id":"person","_rev":"1-877727288","name":"trunky"}]}' "$DB/_bulk_docs?all-or-nothing=true"
[{"id":"person","error":"conflict","reason":"Document update conflict."}]


$ curl -X POST -d '{"all_or_nothing":true,"docs":[{"_id":"person","_rev":"1-877727288","name":"trunky"}]}'
$ curl "$DB/person?conflicts=true"



View raw message