ArangoDB Manual Pages


HTTP Interface for Documents

Documents, Identifiers, Handles

This is an introduction to ArangoDB's REST interface for documents.

Document: Documents in ArangoDB are JSON objects. These objects can be nested (to any depth) and may contains lists. Each document is uniquely identified by its document handle.

An example document:

{
  "_id" : "myusers/2345678",
  "_key" : "3456789",
  "_rev" : "3456789",
  "firstName" : "Hugo",
  "lastName" : "Schlonz",
  "address" : {
    "street" : "Street of Happiness",
    "city" : "Heretown"
  },
  "hobbies" : [
    "swimming",
    "biking",
    "programming"
  ]
}

All documents contain special attributes: the document handle in _id, the document's unique key in _key and and the etag aka document revision in _rev. The value of the _key attribute can be specified by the user when creating a document. _id and _key values are immutable once the document has been created. The _rev value is maintained by ArangoDB autonomously.

Document Handle: A document handle uniquely identifies a document in the database. It is a string and consists of the collection's name and the document key (_key attribute) separated by /.

Document Key: A document key uniquely identifies a document in a given collection. It can and should be used by clients when specific documents are searched. Document keys are stored in the _key attribute of documents. The key values are automatically indexed by ArangoDB in a collection's primary index. Thus looking up a document by its key is regularly a fast operation. The _key value of a document is immutable once the document has been created.

By default, ArangoDB will auto-generate a document key if no _key attribute is specified, and use the user-specified _key otherwise.

This behavior can be changed on a per-collection level by creating collections with the keyOptions attribute.

Using keyOptions it is possible to disallow user-specified keys completely, or to force a specific regime for auto-generating the _key values.

Document Revision: As ArangoDB supports MVCC, documents can exist in more than one revision. The document revision is the MVCC token used to identify a particular revision of a document. It is a string value currently containing an integer number and is unique within the list of document revisions for a single document. Document revisions can be used to conditionally update, replace or delete documents in the database. In order to find a particular revision of a document, you need the document handle and the document revision.

ArangoDB currently uses 64bit unsigned integer values to maintain document revisions internally. When returning document revisions to clients, ArangoDB will put them into a string to ensure the revision id is not clipped by clients that do not support big integers. Clients should treat the revision id returned by ArangoDB as an opaque string when they store or use it locally. This will allow ArangoDB to change the format of revision ids later if this should be required. Clients can use revisions ids to perform simple equality/non-equality comparisons (e.g. to check whether a document has changed or not), but they should not use revision ids to perform greater/less than comparisions with them to check if a document revision is older than one another, even if this might work for some cases.

Note: revision ids have been returned as integers up to including ArangoDB 1.1

Document Etag: The document revision enclosed in double quotes. The revision is returned by several HTTP API methods in the Etag HTTP header.

The basic operations (create, read, update, delete) for documents are mapped to the standard HTTP methods (POST, GET, PUT, DELETE). There is also a partial update method, which is mapped to the HTTP PATCH method.

An identifier for the document revision is returned in the ETag HTTP header. If you modify a document, you can use the If-Match field to detect conflicts. The revision of a document can be checking using the HTTP method HEAD.

Address and ETag of a Document

All documents in ArangoDB have a document handle. This handle uniquely identifies a document. Any document can be retrieved using its unique URI:

http://server:port/_api/document/<document-handle>

For example, assumed that the document handle, which is stored in the _id attribute of the document, is demo/362549736, then the URL of that document is:

http://localhost:8529/_api/document/demo/362549736

The above URL scheme does not specify a database name explicitly, so the default database will be used. To explicitly specify the database context, use the following URL schema:

http://server:port/_db/<database-name>/_api/document/<document-handle>

Example:

http://localhost:8529/_db/mydb/_api/document/demo/362549736

Note that the following examples use the short URL format for brevity.

Each document also has a document revision or etag with is returned in the "ETag" HTTP header when requesting a document.

If you obtain a document using GET and you want to check if a newer revision is available, then you can use the If-None-Match header. If the document is unchanged, a HTTP 412 (precondition failed) error is returned.

If you want to update or delete a document, then you can use the If-Match header. If the document has changed, then the operation is aborted and a HTTP 412 error is returned.

Working with Documents using REST

GET /_api/document/document-handle
(reads a document)

URL parameters

document-handle (string,required)
The handle of the document.

HTTP header parameters

If-None-Match (string,optional)
If the "If-None-Match" header is given, then it must contain exactly one etag. The document is returned, if it has a different revision than the given etag. Otherwise an HTTP 304 is returned.

If-Match (string,optional)
If the "If-Match" header is given, then it must contain exactly one etag. The document is returned, if it has the same revision ad the given etag. Otherwise a HTTP 412 is returned. As an alternative you can supply the etag in an attribute rev in the URL.

Description

Returns the document identified by document-handle. The returned document contains two special attributes: _id containing the document handle and _rev containing the revision.

Return codes

HTTP 200
is returned if the document was found

HTTP 304
is returned if the "If-None-Match" header is given and the document has the same version

HTTP 404
is returned if the document or collection was not found

HTTP 412
is returned if a "If-Match" header or rev is given and the found document has a different version. The response will also contain the found document's current revision in the _rev attribute. Additionally, the attributes _id and _key will be returned.

Examples

Use a document handle:

unix> curl --dump - http://localhost:8529/_api/document/products/347897713

HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
etag: "347897713"

{ 
  "hello" : "world", 
  "_id" : "products/347897713", 
  "_rev" : "347897713", 
  "_key" : "347897713" 
}

Use a document handle and an etag:

unix> curl --header 'If-None-Match: "349011825"' --dump - http://localhost:8529/_api/document/products/349011825

Unknown document handle:

unix> curl --dump - http://localhost:8529/_api/document/products/unknownhandle

HTTP/1.1 404 Not Found
content-type: application/json; charset=utf-8

{ 
  "error" : true, 
  "errorMessage" : "document /_api/document/products/unknownhandle not found", 
  "code" : 404, 
  "errorNum" : 1202 
}

POST /_api/document
(creates a document)

Body parameters

document (json,required)
A JSON representation of the document.

Query parameters

collection (string,required)
The collection name.

createCollection (boolean,optional)
If this parameter has a value of true or yes, then the collection is created if it does not yet exist. Other values will be ignored so the collection must be present for the operation to succeed.

waitForSync (boolean,optional)
Wait until document has been synced to disk.

Description

Creates a new document in the collection named collection. A JSON representation of the document must be passed as the body of the POST request.

If the document was created successfully, then the "Location" header contains the path to the newly created document. The "ETag" header field contains the revision of the document.

The body of the response contains a JSON object with the following attributes:

  • _id contains the document handle of the newly created document
  • _key contains the document key
  • _rev contains the document revision

If the collection parameter waitForSync is false, then the call returns as soon as the document has been accepted. It will not wait until the document has been synced to disk.

Optionally, the URL parameter waitForSync can be used to force synchronisation of the document creation operation to disk even in case that the waitForSync flag had been disabled for the entire collection. Thus, the waitForSync URL parameter can be used to force synchronisation of just this specific operations. To use this, set the waitForSync parameter to true. If the waitForSync parameter is not specified or set to false, then the collection's default waitForSync behavior is applied. The waitForSync URL parameter cannot be used to disable synchronisation for collections that have a default waitForSync value of true.

Return codes

HTTP 201
is returned if the document was created successfully and waitForSync was true.

HTTP 202
is returned if the document was created successfully and waitForSync was false.

HTTP 400
is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case.

HTTP 404
is returned if the collection specified by collection is unknown. The response body contains an error document in this case.

Examples

Create a document given a collection named products. Note that the revision identifier might or might not by equal to the auto-generated key.

unix> curl -X POST --data @- --dump - http://localhost:8529/_api/document?collection=products
{ "Hello": "World" }

HTTP/1.1 201 Created
content-type: application/json; charset=utf-8
etag: "343703409"
location: /_db/_system/_api/document/products/343703409

{ 
  "error" : false, 
  "_id" : "products/343703409", 
  "_rev" : "343703409", 
  "_key" : "343703409" 
}

Create a document in a collection named products with a collection-level waitForSync value of false.

unix> curl -X POST --data @- --dump - http://localhost:8529/_api/document?collection=products
{ "Hello": "World" }

HTTP/1.1 202 Accepted
content-type: application/json; charset=utf-8
etag: "344751985"
location: /_db/_system/_api/document/products/344751985

{ 
  "error" : false, 
  "_id" : "products/344751985", 
  "_rev" : "344751985", 
  "_key" : "344751985" 
}

Create a document in a collection with a collection-level waitForSync value of false, but using the waitForSync URL parameter.

unix> curl -X POST --data @- --dump - http://localhost:8529/_api/document?collection=products&waitForSync=true
{ "Hello": "World" }

HTTP/1.1 201 Created
content-type: application/json; charset=utf-8
etag: "345800561"
location: /_db/_system/_api/document/products/345800561

{ 
  "error" : false, 
  "_id" : "products/345800561", 
  "_rev" : "345800561", 
  "_key" : "345800561" 
}

Create a document in a new, named collection

unix> curl -X POST --data @- --dump - http://localhost:8529/_api/document?collection=products&createCollection=true
{ "Hello": "World" }

HTTP/1.1 202 Accepted
content-type: application/json; charset=utf-8
etag: "346849137"
location: /_db/_system/_api/document/products/346849137

{ 
  "error" : false, 
  "_id" : "products/346849137", 
  "_rev" : "346849137", 
  "_key" : "346849137" 
}

Unknown collection name:

unix> curl -X POST --data @- --dump - http://localhost:8529/_api/document?collection=products
{ "Hello": "World" }

HTTP/1.1 404 Not Found
content-type: application/json; charset=utf-8

{ 
  "error" : true, 
  "errorMessage" : "collection 'products' not found", 
  "code" : 404, 
  "errorNum" : 1203 
}

Illegal document:

unix> curl -X POST --data @- --dump - http://localhost:8529/_api/document?collection=products
{ 1: "World" }

HTTP/1.1 400 Bad Request
content-type: application/json; charset=utf-8

{ 
  "error" : true, 
  "errorMessage" : "expecting attribute name", 
  "code" : 400, 
  "errorNum" : 600 
}

PUT /_api/document/document-handle
(replaces a document)

Body parameters

document (json,required)
A JSON representation of the new document.

URL parameters

document-handle (string,required)
The handle of the document.

Query parameters

waitForSync (boolean,optional)
Wait until document has been synced to disk.

rev (string,optional)
You can conditionally replace a document based on a target revision id by using the rev URL parameter.

policy (string,optional)
To control the update behavior in case there is a revision mismatch, you can use the policy parameter (see below).

HTTP header parameters

If-Match (string,optional)
You can conditionally replace a document based on a target revision id by using the if-match HTTP header.

Description

Completely updates (i.e. replaces) the document identified by document-handle. If the document exists and can be updated, then a HTTP 201 is returned and the "ETag" header field contains the new revision of the document.

If the new document passed in the body of the request contains the document-handle in the attribute _id and the revision in _rev, these attributes will be ignored. Only the URI and the "ETag" header are relevant in order to avoid confusion when using proxies.

Optionally, the URL parameter waitForSync can be used to force synchronisation of the document replacement operation to disk even in case that the waitForSync flag had been disabled for the entire collection. Thus, the waitForSync URL parameter can be used to force synchronisation of just specific operations. To use this, set the waitForSync parameter to true. If the waitForSync parameter is not specified or set to false, then the collection's default waitForSync behavior is applied. The waitForSync URL parameter cannot be used to disable synchronisation for collections that have a default waitForSync value of true.

The body of the response contains a JSON object with the information about the handle and the revision. The attribute _id contains the known document-handle of the updated document, the attribute _rev contains the new document revision.

If the document does not exist, then a HTTP 404 is returned and the body of the response contains an error document.

There are two ways for specifying the targeted document revision id for conditional replacements (i.e. replacements that will only be executed if the revision id found in the database matches the document revision id specified in the request):

  • specifying the target revision in the rev URL query parameter
  • specifying the target revision in the if-match HTTP header

Specifying a target revision is optional, however, if done, only one of the described mechanisms must be used (either the rev URL parameter or the if-match HTTP header). Regardless which mechanism is used, the parameter needs to contain the target document revision id as returned in the _rev attribute of a document or by an HTTP etag header.

For example, to conditionally replace a document based on a specific revision id, you can use the following request:

  • PUT /_api/document/document-handle?rev=etag

If a target revision id is provided in the request (e.g. via the etag value in the rev URL query parameter above), ArangoDB will check that the revision id of the document found in the database is equal to the target revision id provided in the request. If there is a mismatch between the revision id, then by default a HTTP 412 conflict is returned and no replacement is performed.

The conditional update behavior can be overriden with the policy URL query parameter:

  • PUT /_api/document/document-handle?policy=policy

If policy is set to error, then the behavior is as before: replacements will fail if the revision id found in the database does not match the target revision id specified in the request.

If policy is set to last, then the replacement will succeed, even if the revision id found in the database does not match the target revision id specified in the request. You can use the last policy to force replacements.

Return codes

HTTP 201
is returned if the document was replaced successfully and waitForSync was true.

HTTP 202
is returned if the document was replaced successfully and waitForSync was false.

HTTP 400
is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case.

HTTP 404
is returned if the collection or the document was not found

HTTP 412
is returned if a "If-Match" header or rev is given and the found document has a different version. The response will also contain the found document's current revision in the _rev attribute. Additionally, the attributes _id and _key will be returned.

Examples

Using document handle:

unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/document/products/353075057
{"Hello": "you"}

HTTP/1.1 202 Accepted
content-type: application/json; charset=utf-8
etag: "353468273"
location: /_db/_system/_api/document/products/353075057

{ 
  "error" : false, 
  "_id" : "products/353075057", 
  "_rev" : "353468273", 
  "_key" : "353075057" 
}

Unknown document handle:

unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/document/products/354451313
{}

HTTP/1.1 404 Not Found
content-type: application/json; charset=utf-8

{ 
  "error" : true, 
  "errorMessage" : "document /_api/document/products/354451313 not found", 
  "code" : 404, 
  "errorNum" : 1202 
}

Produce a revision conflict:

unix> curl -X PUT --header 'If-Match: "356220785"' --data @- --dump - http://localhost:8529/_api/document/products/355827569
{"other":"content"}

HTTP/1.1 412 Precondition Failed
content-type: application/json; charset=utf-8
etag: "355827569"

{ 
  "error" : true, 
  "code" : 412, 
  "errorNum" : 1200, 
  "errorMessage" : "precondition failed", 
  "_id" : "products/355827569", 
  "_rev" : "355827569", 
  "_key" : "355827569" 
}

Last write wins:

unix> curl -X PUT --header 'If-Match: "357793649"' --data @- --dump - http://localhost:8529/_api/document/products/357400433?policy=last
{}

HTTP/1.1 202 Accepted
content-type: application/json; charset=utf-8
etag: "358055793"
location: /_db/_system/_api/document/products/357400433

{ 
  "error" : false, 
  "_id" : "products/357400433", 
  "_rev" : "358055793", 
  "_key" : "357400433" 
}

Alternative to header field:

unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/document/products/359038833?rev=359432049
{"other":"content"}

HTTP/1.1 412 Precondition Failed
content-type: application/json; charset=utf-8
etag: "359038833"

{ 
  "error" : true, 
  "code" : 412, 
  "errorNum" : 1200, 
  "errorMessage" : "precondition failed", 
  "_id" : "products/359038833", 
  "_rev" : "359038833", 
  "_key" : "359038833" 
}

PATCH /_api/document/document-handle
(patches a document)

Body parameters

document (json,required)
A JSON representation of the document update.

URL parameters

document-handle (string,required)
The handle of the document.

Query parameters

keepNull (boolean,optional)
If the intention is to delete existing attributes with the patch command, the URL query parameter keepNull can be used with a value of false. This will modify the behavior of the patch command to remove any attributes from the existing document that are contained in the patch document with an attribute value of null.

waitForSync (boolean,optional)
Wait until document has been synced to disk.

rev (string,optional)
You can conditionally patch a document based on a target revision id by using the rev URL parameter.

policy (string,optional)
To control the update behavior in case there is a revision mismatch, you can use the policy parameter.

HTTP header parameters

If-Match (string,optional)
You can conditionally patch a document based on a target revision id by using the if-match HTTP header.

Description

Partially updates the document identified by document-handle. The body of the request must contain a JSON document with the attributes to patch (the patch document). All attributes from the patch document will be added to the existing document if they do not yet exist, and overwritten in the existing document if they do exist there.

Setting an attribute value to null in the patch document will cause a value of null be saved for the attribute by default.

Optionally, the URL parameter waitForSync can be used to force synchronisation of the document update operation to disk even in case that the waitForSync flag had been disabled for the entire collection. Thus, the waitForSync URL parameter can be used to force synchronisation of just specific operations. To use this, set the waitForSync parameter to true. If the waitForSync parameter is not specified or set to false, then the collection's default waitForSync behavior is applied. The waitForSync URL parameter cannot be used to disable synchronisation for collections that have a default waitForSync value of true.

The body of the response contains a JSON object with the information about the handle and the revision. The attribute _id contains the known document-handle of the updated document, the attribute _rev contains the new document revision.

If the document does not exist, then a HTTP 404 is returned and the body of the response contains an error document.

You can conditionally update a document based on a target revision id by using either the rev URL parameter or the if-match HTTP header. To control the update behavior in case there is a revision mismatch, you can use the policy parameter. This is the same as when replacing documents (see replacing documents for details).

Return codes

HTTP 201
is returned if the document was created successfully and waitForSync was true.

HTTP 202
is returned if the document was created successfully and waitForSync was false.

HTTP 400
is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case.

HTTP 404
is returned if the collection or the document was not found

HTTP 412
is returned if a "If-Match" header or rev is given and the found document has a different version. The response will also contain the found document's current revision in the _rev attribute. Additionally, the attributes _id and _key will be returned.

Examples

patches an existing document with new content.

unix> curl -X PATCH --data @- --dump - http://localhost:8529/_api/document/products/360611697
{"hello":"world"}

HTTP/1.1 202 Accepted
content-type: application/json; charset=utf-8
etag: "361004913"
location: /_db/_system/_api/document/products/360611697

{ 
  "error" : false, 
  "_id" : "products/360611697", 
  "_rev" : "361004913", 
  "_key" : "360611697" 
}

unix> curl -X PATCH --data @- --dump - http://localhost:8529/_api/document/products/360611697
{"numbers":{"one":1,"two":2,"three":3,"empty":null}}

HTTP/1.1 202 Accepted
content-type: application/json; charset=utf-8
etag: "361594737"
location: /_db/_system/_api/document/products/360611697

{ 
  "error" : false, 
  "_id" : "products/360611697", 
  "_rev" : "361594737", 
  "_key" : "360611697" 
}

unix> curl --dump - http://localhost:8529/_api/document/products/360611697

HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
etag: "361594737"

{ 
  "one" : "world", 
  "hello" : "world", 
  "numbers" : { 
    "empty" : null, 
    "one" : 1, 
    "two" : 2, 
    "three" : 3 
  }, 
  "_id" : "products/360611697", 
  "_rev" : "361594737", 
  "_key" : "360611697" 
}

unix> curl -X PATCH --data @- --dump - http://localhost:8529/_api/document/products/360611697?keepNull=false
{"hello":null,"numbers":{"four":4}}

HTTP/1.1 202 Accepted
content-type: application/json; charset=utf-8
etag: "362053489"
location: /_db/_system/_api/document/products/360611697

{ 
  "error" : false, 
  "_id" : "products/360611697", 
  "_rev" : "362053489", 
  "_key" : "360611697" 
}

unix> curl --dump - http://localhost:8529/_api/document/products/360611697

HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
etag: "362053489"

{ 
  "one" : "world", 
  "numbers" : { 
    "empty" : null, 
    "one" : 1, 
    "two" : 2, 
    "three" : 3, 
    "four" : 4 
  }, 
  "_id" : "products/360611697", 
  "_rev" : "362053489", 
  "_key" : "360611697" 
}

DELETE /_api/document/document-handle
(deletes a document)

URL parameters

document-handle (string,required)
Deletes the document identified by document-handle.

Query parameters

rev (string,optional)
You can conditionally delete a document based on a target revision id by using the rev URL parameter.

policy (string,optional)
To control the update behavior in case there is a revision mismatch, you can use the policy parameter. This is the same as when replacing documents (see replacing documents for more details).

waitForSync (boolean,optional)
Wait until document has been synced to disk.

HTTP header parameters

If-Match (string,optional)
You can conditionally delete a document based on a target revision id by using the if-match HTTP header.

Description

The body of the response contains a JSON object with the information about the handle and the revision. The attribute _id contains the known document-handle of the deleted document, the attribute _rev contains the document revision.

If the waitForSync parameter is not specified or set to false, then the collection's default waitForSync behavior is applied. The waitForSync URL parameter cannot be used to disable synchronisation for collections that have a default waitForSync value of true.

Return codes

HTTP 200
is returned if the document was deleted successfully and waitForSync was true.

HTTP 202
is returned if the document was deleted successfully and waitForSync was false.

HTTP 404
is returned if the collection or the document was not found. The response body contains an error document in this case.

HTTP 412
is returned if a "If-Match" header or rev is given and the found document has a different version. The response will also contain the found document's current revision in the _rev attribute. Additionally, the attributes _id and _key will be returned.

Examples

Using document handle:

unix> curl -X DELETE --dump - http://localhost:8529/_api/document/products/363102065

HTTP/1.1 200 OK
content-type: application/json; charset=utf-8

{ 
  "error" : false, 
  "_id" : "products/363102065", 
  "_rev" : "363102065", 
  "_key" : "363102065" 
}

Unknown document handle:

unix> curl -X DELETE --dump - http://localhost:8529/_api/document/products/364347249

HTTP/1.1 404 Not Found
content-type: application/json; charset=utf-8

{ 
  "error" : true, 
  "errorMessage" : "document /_api/document/products/364347249 not found", 
  "code" : 404, 
  "errorNum" : 1202 
}

Revision conflict:

unix> curl -X DELETE --header 'If-Match: "366116721"' --dump - http://localhost:8529/_api/document/products/365723505

HTTP/1.1 412 Precondition Failed
content-type: application/json; charset=utf-8
etag: "365723505"

{ 
  "error" : true, 
  "code" : 412, 
  "errorNum" : 1200, 
  "errorMessage" : "precondition failed", 
  "_id" : "products/365723505", 
  "_rev" : "365723505", 
  "_key" : "365723505" 
}

HEAD /_api/document/document-handle
(reads a document header)

URL parameters

document-handle (string,required)
The handle of the document.

Query parameters

rev (string,optional)
You can conditionally fetch a document based on a target revision id by using the rev URL parameter.

HTTP header parameters

If-None-Match (string,optional)
If the "If-None-Match" header is given, then it must contain exactly one etag. If the current document revision is different to the specified etag, an HTTP 200 response is returned. If the current document revision is identical to the specified etag, then an HTTP 304 is returned.

If-Match (string,optional)
You can conditionally fetch a document based on a target revision id by using the if-match HTTP header.

Description

Like GET, but only returns the header fields and not the body. You can use this call to get the current revision of a document or check if the document was deleted.

Return codes

HTTP 200
is returned if the document was found

HTTP 304
is returned if the "If-None-Match" header is given and the document has same version

HTTP 404
is returned if the document or collection was not found

HTTP 412
is returned if a "If-Match" header or rev is given and the found document has a different version. The response will also contain the found document's current revision in the etag header.

Examples

unix> curl -X HEAD --dump - http://localhost:8529/_api/document/products/351960945

reads all documents from collection

GET /_api/document
(reads all documents from collection)

Query parameters

collection (string,required)
The name of the collection.

Description

Returns a list of all URI for all documents from the collection identified by collection.

Return codes

HTTP 200
All went good.

HTTP 404
The collection does not exist.

Examples

Returns a all ids.

unix> curl --dump - http://localhost:8529/_api/document/?collection=products

HTTP/1.1 200 OK
content-type: application/json; charset=utf-8

{ 
  "documents" : [ 
    "/_api/document/products/350191473", 
    "/_api/document/products/350912369", 
    "/_api/document/products/350584689" 
  ] 
}

Collection does not exist.

unix> curl --dump - http://localhost:8529/_api/document/?collection=doesnotexist

HTTP/1.1 404 Not Found
content-type: application/json; charset=utf-8

{ 
  "error" : true, 
  "errorMessage" : "collection 'doesnotexist' not found", 
  "code" : 404, 
  "errorNum" : 1203 
}