1
0
Fork 0

updated documentation

This commit is contained in:
Jan Steemann 2013-11-01 13:59:51 +01:00
parent d49b754f49
commit 33736b8e30
2 changed files with 39 additions and 14 deletions

View File

@ -48,34 +48,46 @@ 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` header field.
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 {#RestDocumentResource}
======================================================
All documents in ArangoDB have a document handle. This handle uniquely defines a
document and is managed by ArangoDB. All documents are found under the URI:
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
http://server:port/_api/document/<document-handle>
For example: Assume that the document handle, which is stored in the `_id`
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" header field when requesting a document.
"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` is returned.
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` is returned.
412` error is returned.
Working with Documents using REST {#RestDocumentHttp}
=====================================================

View File

@ -31,20 +31,33 @@ Documents, Identifiers, Handles {#RestEdgeIntro}
Address and ETag of an Edge {#RestEdgeResource}
===============================================
All documents in ArangoDB have a document handle. This handle uniquely defines a
document and is managed by ArangoDB. All documents are found under the URI
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
http://server:port/_api/document/<document-handle>
For edges you can use the special address
Edges are a special variation of documents, and to work with edges, the above URL
format changes to:
http://server:port/_api/edge/document-handle
http://server:port/_api/edge/<document-handle>
For example: Assume that the document handle, which is stored in the `_id`
For example, assumed that the document handle, which is stored in the `_id`
attribute of the edge, is `demo/362549736`, then the URL of that edge is:
http://localhost:8529/_api/edge/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/edge/<document-handle>
Example:
http://localhost:8529/_db/mydb/_api/edge/demo/362549736
Note that the following examples use the short URL format for brevity.
Working with Edges using REST {#RestEdgeHttp}
=============================================