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] Trivial Update of "HTTP_Bulk_Document_API" by bass
Date Wed, 13 Feb 2013 15:33:49 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 bass:
http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API?action=diff&rev1=21&rev2=22

  Note that this changes the interpretation of the {{{_rev}}} parameter in each document:
rather than being the ''parent'' revision ID to be matched against, it's the ''existing''
revision ID that will be saved as-is into the database. And since it's important to retain
revision history when adding to the database, each document body in this mode should have
a {{{_revisions}}} property that lists its revision history; the format of this property is
described on the [[HTTP_Document_API]] page under "Accessing Previous Revisions". For example:
  
  {{{
- $ curl -X POST -d '{"new_edits":false,"docs":[{"_id":"person","_rev":"2-3595405","_revisions":{"start":2,"ids":["3595405","877727288"]},"name":"jim"]}'
"$OTHER_DB/_bulk_docs"
+ $ curl -X POST -d '{"new_edits":false,"docs":[{"_id":"person","_rev":"2-3595405","_revisions":{"start":2,"ids":["3595405","877727288"]},"name":"jim"}]}'
"$OTHER_DB/_bulk_docs"
  }}}
  
  This command will replicate one of the revisions created above, into a separate database
{{{$OTHER_DB}}}. It will have the same revision ID as in {{{$DB}}}, {{{"2-3595405"}}}, and
it will be known to have a parent revision with ID {{{1-877727288}}}. (Even though {{{$OTHER_DB}}}
will not have the body of that revision, the history will help it detect conflicts in future
replications.)

Mime
View raw message