Documents

Read document

Fetch the document identified by key. The returned document contains three special attributes:

  • _id containing the document handle.
  • _key containing key which uniquely identifies a document.
  • _rev containing the revision.
get/_fabric/{fabric}/_api/document/{collection}/{key}

Request

Path parameters

fabricstring string required

The name of the fabric.

collectionstring string required

The name of the collection.

keystring string required

The key of the document.

Headers

If-None-Matchstring

If the If-None-Match header is given, it must contain exactly one ETag. The document is returned, if it has a different revision than the given ETag. Otherwise a HTTP 304 is returned.

If-Matchstring

If the If-Match header is given, it must contain exactly one ETag. The document is returned, if it has the same revision as the given ETag. Otherwise a HTTP 412 is returned.

Response

Successfully fetched document.

_idstring

ID of the collection.

_keystring

_key details of collection.

_revstring

_rev details of collection.

datastring

data in record.

Example response

{
  "_id": "test/foo",
  "_key": "foo",
  "_rev": "_dPRuHxe--_",
  "data": "data1"
}

Changes

No recorded changes to this operation across all 1 revision of this API.