GET /{db}/{local-doc-id}

In this document

This request retrieves a local document.

Request


Request headers

Query parameters

The following query parameters are all optional.

NameTypeDescriptionDefault
attachments BooleanInclude attachment bodies in responsefalse
att_encoding_info BooleanInclude encoding information in attachment stubs if the attachment is compressedfalse
atts_since arrayInclude attachments only since specified revisions. Does not include attachments for specified revisionsnone
conflicts BooleanInclude information about conflicts in documentfalse
deleted_conflicts BooleanInclude information about deleted conflicted revisionsfalse
latest BooleanForce retrieval of latest leaf revision, no matter what revision was requestedfalse
local_seq BooleanInclude last update sequence number for the documentfalse
meta BooleanActs same as specifying all conflicts, deletedconflicts and openrevs query parametersfalse
open_revs arrayRetrieve documents of specified leaf revisions. You can specify the value all to return all leaf revisionsnone
rev stringRetrieve the specified revision of the documentnone
revs BooleanInclude a list of all known document revisionsfalse
revs_info BooleanInclude detailed information for all known document revisionsfalse

Response


The response contains a JSON document in the message body.

Response headers

Message body

The message body contains the following objects in a JSON document.

NameTypeDescription
_id stringDocument identifier
_rev stringrevision identifier
_deleted BooleanIndicates whether the document is deleted. Appears only when the document was deleted.
_attachments objectStubs for the attachments. Appears only when the document has attachments.
_conflicts arrayList of revisions with conflicts. Appears only when the request uses the conflicts=true query parameter.
_deleted_conflicts arrayList of revisions with conflicts that were deleted. Appears only when the request uses the deleted_conflicts=true query parameter.
_local_seq integerSequence number of the document in the database. Appears only when the request uses the local_seq=true query parameter.
_revs_info arrayList of objects with information about local revisions and their status. Appears only when the request uses the open_revs=true query parameter.
_revisions objectList of local revision identifiers. Appears only when the request uses the revs=true query parameter.

Example


The following example retrieves a local document with the identifier _local/RecipeLists from a database named cookbook.

Request

GET /cookbook/_local/RecipeLists
Host: localhost:59840

Response

{
    "_id": "_local/RecipeLists",
    "_rev": "2-local",
    "favorite-recipes": [
        "LemonChicken",
        "ChickenParm",
        "ChickenSoup"
    ],
    "recipes-to-try": [
        "BLTSalad",
        "PastaPrimavera",
        "ChocolateBundtCake",
        "Milanesas",
        "BarleyVeggieSoup"
    ]
}