We have a new wiki. The migration is not 100% complete. You can help out by moving pages across. This wiki will exist for as long as there are pages left.

The official documentation has moved to http://docs.couchdb.org — The transition is not 100% complete, but http://docs.couchdb.org should be seen as having the latest info. In some cases, the wiki still has some more or older info on certain topics inside CouchDB.

You need to be added to the ContributorsGroup to edit the wiki. But don't worry! Just email any Mailing List or grab us on IRC and let us know your user name.

HTTP POST _revs_diff





Query args


Request body

JSON object whose keys are document IDs and values arrays of revision IDs

Response body

JSON object describing which revisions are not in the database


Given a set of document/revision IDs, returns the subset of those that do not correspond to revisions stored in the database.

Its primary use is by the replicator, as an important optimization: after receiving a set of new revision IDs from the source database, the replicator sends this set to the destination database's _revs_diff to find out which of them already exist there. It can then avoid fetching and sending already-known document bodies.

Both the request and response bodies are JSON objects whose keys are document IDs; but the values are structured differently:

Disclaimer: This information was derived from mailing-list posts and experimentation and has not yet been reviewed by someone familiar with the implementation. --JensAlfke, Dec. 2011


POST /_revs_diff HTTP/1.1
Content-Type: application/json

{"03ee06461a12f3c288bb865b22000170": ["1-b2e54331db828310f3c772d6e042ac9c", "2-3a24009a9525bde9e4bfa8a99046b00d"],
 "82e04f650661c9bdb88c57e044000a4b": ["3-bb39f8c740c6ffb8614c7031b46ac162"]}

HTTP/1.1 200 OK
Cache-Control: must-revalidate

{"03ee06461a12f3c288bb865b22000170": {"missing": ["2-3a24009a9525bde9e4bfa8a99046b00d"]}}

HttpPostRevsDiff (last edited 2012-02-07 02:09:29 by 12)