couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Couchdb Wiki] Trivial Update of "HTTP_Bulk_Document_API" by bass
Date Sun, 27 Jan 2013 23:01:39 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:

  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"}]}'
+ $ curl -X POST -d '{"new_edits":false,"docs":[{"_id":"person","_rev":"2-3595405","_revisions":{"start":2,"ids":["3595405","877727288"]},"name":"jim"]}'
  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

View raw message