Method | GET /db/doc | |
Request | None | |
Response | Returns the JSON for the document | |
Admin Privileges Required | no | |
Query Arguments | Argument | conflicts |
Description | Returns the conflict tree for the document. | |
Optional | yes | |
Type | boolean | |
Default | false | |
Supported Values | ||
true | Includes the revisions | |
Argument | rev | |
Description | Specify the revision to return | |
Optional | yes | |
Type | string | |
Supported Values | ||
true | Includes the revisions | |
Argument | revs | |
Description | Return a list of the revisions for the document | |
Optional | yes | |
Type | boolean | |
Argument | revs_info | |
Description | Return a list of detailed revision information for the document | |
Optional | yes | |
Type | boolean | |
Supported Values | ||
true | Includes the revisions | |
Return Codes | ||
201 | Document created | |
400 | The format of the request or revision was invalid | |
404 | The specified document or revision cannot be found, or has been deleted | |
409 | Conflict - a document with the specified document ID already exists |
Returns the specified doc
from the specified
db
. For example, to retrieve the document with
the id FishStew
you would send the following
request:
GET http://couchdb:5984/recipes/FishStew Content-Type: application/json Accept: application/json
The returned JSON is the JSON of the document, including the document ID and revision number:
{ "_id" : "FishStew", "_rev" : "3-a1a9b39ee3cc39181b796a69cb48521c", "servings" : 4, "subtitle" : "Delicious with a green salad", "title" : "Irish Fish Stew" }
Unless you request a specific revision, the latest revision of the document will always be returned.