GET /{db}

In this document

This request retrieves information about a database.

Request


Request headers

This request does not have any required headers.

Query parameters

This request does not use query parameters.

Message body

This request does not use a message body.

Response


Status codes

Response headers

This response uses only standard HTTP headers.

Message body

The message body is a JSON document that contains the following objects:

NameTypeDescription
committed_update_seqIntegerNumber of committed updates to the database
db_nameStringName of the database
db_uuidStringDatabase identifier
disk_format_versionIntegerDatabase schema version
disk_sizeIntegerTotal amount of data stored on the disk. Units: bytes
doc_countIntegerNumber of documents in the database
instance_start_timeIntegerDate and time the database was opened. Units: microseconds since the epoch (1 January 1970)
purge_seqIntegerReturns 0.
update_seqIntegerNumber of updates to the database

Example


The following example retrieves information about a database named beer-db.

Request

GET /beer-db HTTP/1.1
Host: localhost:59840

Response

HTTP/1.1 200 OK
Server: CouchbaseLite 1.485
Content-Type: application/json
Accept-Ranges: bytes
Content-Length: 281
Cache-Control: must-revalidate
Date: Fri, 06 Dec 2013 22:31:17 GMT
{
  "instance_start_time" : 1386620242527997,
  "committed_update_seq" : 25800,
  "disk_size" : 15360000,
  "purge_seq" : 0,
  "db_uuid" : "65FB16DF-FFD7-4514-9E8D-B734B066D28D",
  "doc_count" : 5048,
  "db_name" : "beer-db",
  "update_seq" : 25800,
  "disk_format_version" : 11
}

The following example shows the response returned when you request information about a database that does not exist on the server. The example requests information about a database named cookbook, which does not exist on the server.

Request

GET /cookbook HTTP/1.1
Host: localhost:59840

Response

HTTP/1.1 404 Not Found
Transfer-Encoding: chunked
Accept-Ranges: bytes
Content-Type: application/json
Server: CouchbaseLite 1.485
Date: Sun, 08 Dec 2013 20:16:50 GMT
{
  "status" : 404,
  "error" : "not_found"
}