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 RobertNewson
Date Thu, 26 Jul 2012 13:12:29 GMT
Dear Wiki user,

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

The "HTTP_Bulk_Document_API" page has been changed by RobertNewson:
http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API?action=diff&rev1=16&rev2=17

Comment:
add note that the result of bulk_docs preserves the order of the the request.

  {"id":"baz","key":"baz","value":{"rev":"1-2842770487"},"doc":{"_id":"baz","_rev":"1-2842770487","name":"trunky"}}
  ]}
  }}}
+ 
+ The rows are returned in the same order as the supplied "keys" array.
+ 
  Example with startkey and endkey ('''be aware''' of correct url encoding!):
  
  {{{
@@ -38, +41 @@

  {"id":"baz","key":"baz","value":{"rev":"1-2842770487"},"doc":{"_id":"baz","_rev":"1-2842770487","name":"trunky"}}
  ]}
  }}}
+ 
  == 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.
  
@@ -70, +74 @@

      {"id":"2","rev":"1-2063452834"}
  ]
  }}}
+ 
+ The results are returned in the same order as the supplied "docs" array.
+ 
  Updating existing documents requires setting the ''_rev'' member to the revision being updated.
To delete a document set the ''_deleted'' member to true.
  
  {{{#!highlight javascript

Mime
View raw message