couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "HTTP Bulk Document API" by BrianChamberlain
Date Wed, 06 May 2009 19:13:58 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The following page has been changed by BrianChamberlain:
http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API

------------------------------------------------------------------------------
  
  === Modify Multiple Documents With a Single Request ===
  
- CouchDB provides a bulk insert/update feature. To use this, you make a ''POST'' request
to the URI ''/{dbname}/_bulk_docs'', with the request body being a JSON document containing
a list of new documents to be inserted or updated. 
+ CouchDB provides a bulk insert/update feature. To use this, you make a ''POST'' request
to the URI ''/{dbname}/_bulk_docs'', with the request body being a JSON document containing
a list of new documents to be inserted or updated.
+ 
+ For example (with curl):
+ {{{
+ $ DB="http://127.0.0.1:5984/mydb"
+ $ curl -v -d '{"docs":[{"key":"baz","name":"bazzel"},{"key":"bar","name":"barry"}]}' -X
POST $DB/_bulk_doc
+ $ curl -v -d @your_file.json -X POST $DB/_bulk_doc 
+ }}}
  
  Doc formats below are as per CouchDB 0.9.x.
  

Mime
View raw message