6.2.2. Getting a List of Revisions

You can obtain a list of the revisions for a given document by adding the revs=true parameter to the request URL. For example:

GET http://couchdb:5984/recipes/FishStew?revs=true
Accept: application/json

The returned JSON structure includes the original document, including a _revisions structure that includes the revision information:

{
   "servings" : 4,
   "subtitle" : "Delicious with a green salad",
   "_id" : "FishStew",
   "title" : "Irish Fish Stew",
   "_revisions" : {
      "ids" : [
         "a1a9b39ee3cc39181b796a69cb48521c",
         "7c4740b4dcf26683e941d6641c00c39d",
         "9c65296036141e575d32ba9c034dd3ee"
      ],
      "start" : 3
   },
   "_rev" : "3-a1a9b39ee3cc39181b796a69cb48521c"
}

Table 6.5.  Returned CouchDB Document with Revision Info

FieldDescription
_id (optional) Document ID
_rev (optional) Revision ID (when updating an existing document)
_revisions CouchDB Document Revisions
        ids [array] Array of valid revision IDs, in reverse order (latest first)
        start Prefix number for the latest revision