1
0
Fork 0
This commit is contained in:
Heiko Kernbach 2014-08-08 13:04:56 +02:00
commit cbcca7cb51
40 changed files with 844 additions and 818 deletions

View File

@ -1,4 +1,55 @@
v2.2.1 (XXXX-XX-XX)
v2.2.2-rc1 (XXXX-XX-XX)
-------------------
* allow storing non-reserved attribute names starting with an underscore
Previous versions of ArangoDB parsed away all attribute names that started with an
underscore (e.g. `_test', '_foo', `_bar`) on all levels of a document (root level
and sub-attribute levels). While this behavior was documented, it was unintuitive and
prevented storing documents inside other documents, e.g.:
{
"_key" : "foo",
"_type" : "mydoc",
"references" : [
{
"_key" : "something",
"_rev" : "...",
"value" : 1
},
{
"_key" : "something else",
"_rev" : "...",
"value" : 2
}
]
}
In the above example, previous versions of ArangoDB removed all attributes and
sub-attributes that started with underscores, meaning the embedded documents would lose
some of their attributes. 2.2.2 should preserve such attributes, and will also allow
storing user-defined attribute names on the top-level even if they start with underscores
(such as `_type` in the above example).
* fix conversion of JavaScript String, Number and Boolean objects to JSON.
Objects created in JavaScript using `new Number(...)`, `new String(...)`, or
`new Boolean(...)` were not converted to JSON correctly.
* fixed a race condition on task registration (i.e. `require("org/arangodb/tasks").register()`)
this race condition led to undefined behavior when a just-created task with no offset and
no period was instantly executed and deleted by the task scheduler, before the `register`
function returned to the caller.
* changed run-tests.sh to execute all suitable tests.
* switch to new version of gyp
* fixed upgrade button
v2.2.1 (2014-07-24)
-------------------
* fixed hanging write-ahead log recovery for certain cases that involved dropping
@ -6,6 +57,10 @@ v2.2.1 (XXXX-XX-XX)
* fixed issue with --check-version: when creating a new database the check failed
* issue #947 Foxx applicationContext missing some properties
* fixed issue with --check-version: when creating a new database the check failed
* added startup option `--wal.suppress-shape-information`
Setting this option to `true` will reduce memory and disk space usage and require

View File

@ -220,14 +220,9 @@ ArangoDB:
- *_rev*: this attribute contains the revision number of a document. However, the
revision numbers are managed by ArangoDB and cannot be specified on import. Thus
any value in this attribute is ignored on import.
- all other attributes starting with an underscore are discarded on import without
any warnings.
If you import values into *_key*, you should make sure they are valid and unique.
When importing data into an edge collection, you should make sure that all import
documents can *_from* and *_to* and that their values point to existing documents.
Finally you should make sure that all other attributes in the import file do not
start with an underscore - otherwise they might be discarded.

View File

@ -15,8 +15,8 @@ following attribute naming constraints are not violated:
attributes are used to reference other documents.
More system attributes may be added in the future without further notice so
end users should not use attribute names starting with an underscore for their
own attributes.
end users should try to avoid using their own attribute names starting with
underscores.
* Attribute names should not start with the at-mark (*@*). The at-mark
at the start of attribute names is reserved in ArangoDB for future use cases.
@ -39,16 +39,15 @@ following attribute naming constraints are not violated:
length is variable and depends on the number and data types of attributes
used.
* Attribute names are case-sensitive.
* Attributes with empty names (the empty string) and attributes with names that
start with an underscore and don't have a special meaning (system attributes)
are removed from the document when saving it.
* Attributes with empty names (the empty string) are removed from the document
when saving it.
When the document is later requested, it will be returned without these
attributes. For example, if this document is saved:
{ "a" : 1, "" : 2, "_test" : 3, "b": 4 }
{ "a" : 1, "" : 2, "b": 3 }
and later requested, it will be returned like this:
{ "a" : 1, "b": 4 }
{ "a" : 1, "b": 3 }

View File

@ -89,7 +89,8 @@ describe ArangoDB do
doc.parsed_response['_rev'].should_not eq('99')
doc.parsed_response.should_not have_key('_from')
doc.parsed_response.should_not have_key('_to')
doc.parsed_response.should_not have_key('_test')
doc.parsed_response.should have_key('_test')
doc.parsed_response['_test'].should eq('c')
doc.parsed_response.should have_key('meow')
doc.parsed_response['meow'].should eq('d')
doc.parsed_response['foo'].should eq('002')
@ -101,7 +102,7 @@ describe ArangoDB do
it "creates a document with nested attribute names" do
cmd = api + "?collection=" + @cn
body = "{ \"a\" : \"1\", \"b\" : { \"b\" : \"2\" , \"a\" : \"3\", \"\": \"4\", \"_from\": \"5\", \"c\" : 6 } }"
body = "{ \"a\" : \"1\", \"b\" : { \"b\" : \"2\" , \"a\" : \"3\", \"\": \"4\", \"_key\": \"moetoer\", \"_from\": \"5\", \"_lol\" : false, \"c\" : 6 } }"
doc = ArangoDB.log_post("#{prefix}-create-duplicate-names", cmd, :body => body)
doc.code.should eq(201)
@ -118,11 +119,13 @@ describe ArangoDB do
doc.parsed_response.should have_key('b')
doc.parsed_response['b'].should_not have_key('')
doc.parsed_response['b'].should_not have_key('_from')
doc.parsed_response['b'].should have_key('_from')
doc.parsed_response['b'].should have_key('_key')
doc.parsed_response['b'].should have_key('_lol')
doc.parsed_response['b'].should have_key('b')
doc.parsed_response['b'].should have_key('a')
doc.parsed_response['b'].should have_key('c')
doc.parsed_response['b'].should eq({ "b" => "2", "a" => "3", "c" => 6 })
doc.parsed_response['b'].should eq({ "b" => "2", "a" => "3", "_key" => "moetoer", "_from" => "5", "_lol" => false, "c" => 6 })
end
################################################################################

View File

@ -429,7 +429,7 @@ bool RestDocumentHandler::readDocument () {
/// @startDocuBlock REST_DOCUMENT_READ
/// @brief reads a single document
///
/// @RESTHEADER{GET /_api/document/document-handle,Read document}
/// @RESTHEADER{GET /_api/document/{document-handle},Read document}
///
/// @RESTURLPARAMETERS
///
@ -835,7 +835,7 @@ bool RestDocumentHandler::getAllDocumentsCoordinator (
/// @startDocuBlock REST_DOCUMENT_READ_HEAD
/// @brief reads a single document head
///
/// @RESTHEADER{HEAD /_api/document/document-handle,Read document header}
/// @RESTHEADER{HEAD /_api/document/{document-handle},Read document header}
///
/// @RESTURLPARAMETERS
///
@ -917,7 +917,7 @@ bool RestDocumentHandler::checkDocument () {
/// @startDocuBlock REST_DOCUMENT_REPLACE
/// @brief replaces a document
///
/// @RESTHEADER{PUT /_api/document/document-handle,Replace document}
/// @RESTHEADER{PUT /_api/document/{document-handle},Replace document}
///
/// @RESTBODYPARAM{document,json,required}
/// A JSON representation of the new document.
@ -1138,7 +1138,7 @@ bool RestDocumentHandler::replaceDocument () {
/// @startDocuBlock REST_DOCUMENT_UPDATE
/// @brief updates a document
///
/// @RESTHEADER{PATCH /_api/document/document-handle, Patch document}
/// @RESTHEADER{PATCH /_api/document/{document-handle}, Patch document}
///
/// @RESTBODYPARAM{document,json,required}
/// A JSON representation of the document update.
@ -1554,7 +1554,7 @@ bool RestDocumentHandler::modifyDocumentCoordinator (
/// @startDocuBlock REST_DOCUMENT_DELETE
/// @brief deletes a document
///
/// @RESTHEADER{DELETE /_api/document/document-handle, Deletes document}
/// @RESTHEADER{DELETE /_api/document/{document-handle}, Deletes document}
///
/// @RESTURLPARAMETERS
///

View File

@ -353,7 +353,7 @@ bool RestEdgeHandler::createDocumentCoordinator (string const& collname,
/// @startDocuBlock API_EDGE_READ
/// @brief reads a single edge
///
/// @RESTHEADER{GET /_api/edge/document-handle, Read edge}
/// @RESTHEADER{GET /_api/edge/{document-handle}, Read edge}
///
/// @RESTURLPARAMETERS
///
@ -433,7 +433,7 @@ bool RestEdgeHandler::createDocumentCoordinator (string const& collname,
/// @startDocuBlock API_EDGE_READ_HEAD
/// @brief reads a single edge head
///
/// @RESTHEADER{HEAD /_api/edge/document-handle, Read edge header}
/// @RESTHEADER{HEAD /_api/edge/{document-handle}, Read edge header}
///
/// @RESTURLPARAMETERS
///
@ -480,7 +480,7 @@ bool RestEdgeHandler::createDocumentCoordinator (string const& collname,
/// @startDocuBlock API_EDGE_REPLACE
/// @brief replaces an edge
///
/// @RESTHEADER{PUT /_api/edge/document-handle,replaces an edge}
/// @RESTHEADER{PUT /_api/edge/{document-handle},replaces an edge}
///
/// @RESTBODYPARAM{edge,json,required}
/// A JSON representation of the new edge data.
@ -608,7 +608,7 @@ bool RestEdgeHandler::createDocumentCoordinator (string const& collname,
/// @startDocuBlock API_EDGE_UPDATES
/// @brief updates an edge
///
/// @RESTHEADER{PATCH /_api/edge/document-handle, Patches edge}
/// @RESTHEADER{PATCH /_api/edge/{document-handle}, Patches edge}
///
/// @RESTBODYPARAM{document,json,required}
/// A JSON representation of the edge update.
@ -712,7 +712,7 @@ bool RestEdgeHandler::createDocumentCoordinator (string const& collname,
/// @startDocuBlock API_EDGE_DELETE
/// @brief deletes an edge
///
/// @RESTHEADER{DELETE /_api/edge/document-handle, Deletes edge}
/// @RESTHEADER{DELETE /_api/edge/{document-handle}, Deletes edge}
///
/// @RESTURLPARAMETERS
///

View File

@ -647,7 +647,7 @@ void RestReplicationHandler::handleCommandLoggerSetConfig () {
////////////////////////////////////////////////////////////////////////////////
/// @brief handle a dump batch command
///
/// @RESTHEADER{PUT /_api/replication/batch/id, Prolong existing dump batch}
/// @RESTHEADER{PUT /_api/replication/batch/{id}, Prolong existing dump batch}
///
/// @RESTBODYPARAM{body,json,required}
/// A JSON object with the batch configration.
@ -687,7 +687,7 @@ void RestReplicationHandler::handleCommandLoggerSetConfig () {
////////////////////////////////////////////////////////////////////////////////
/// @brief handle a dump batch command
///
/// @RESTHEADER{DELETE /_api/replication/batch/id, Deletes an existing dump batch}
/// @RESTHEADER{DELETE /_api/replication/batch/{id}, Deletes an existing dump batch}
///
/// @RESTURLPARAMETERS
///

View File

@ -933,7 +933,7 @@ int ProcessBitarrayIndexFields (v8::Handle<v8::Object> const obj,
// "fields" is a list of fields
v8::Handle<v8::Array> fieldList = v8::Handle<v8::Array>::Cast(obj->Get(TRI_V8_SYMBOL("fields")));
const uint32_t n = fieldList->Length();
uint32_t const n = fieldList->Length();
for (uint32_t i = 0; i < n; ++i) {
if (! fieldList->Get(i)->IsArray()) {
@ -948,7 +948,7 @@ int ProcessBitarrayIndexFields (v8::Handle<v8::Object> const obj,
break;
}
const string f = TRI_ObjectToString(fieldPair->Get(0));
string const f = TRI_ObjectToString(fieldPair->Get(0));
if (f.empty() || (create && f[0] == '_')) {
// accessing internal attributes is disallowed
@ -9903,7 +9903,17 @@ static v8::Handle<v8::Value> MapGetNamedShapedJson (v8::Local<v8::String> name,
v8::String::Utf8Value const str(name);
string const key(*str, (size_t) str.length());
if (key.empty() || key[0] == '_' || strchr(key.c_str(), '.') != 0) {
if (key.empty()) {
return scope.Close(v8::Handle<v8::Value>());
}
if (key[0] == '_' &&
(key == "_key" || key == "_rev" || key == "_id" || key == "_from" || key == "_to")) {
// strip reserved attributes
return scope.Close(v8::Handle<v8::Value>());
}
if (strchr(key.c_str(), '.') != nullptr) {
return scope.Close(v8::Handle<v8::Value>());
}
@ -9954,7 +9964,7 @@ static v8::Handle<v8::Array> KeysOfShapedJson (const v8::AccessorInfo& info) {
// get shaped json
void* marker = TRI_UnwrapClass<void*>(self, WRP_SHAPED_JSON_TYPE);
if (marker == 0) {
if (marker == nullptr) {
return scope.Close(v8::Array::New());
}
@ -10000,7 +10010,7 @@ static v8::Handle<v8::Array> KeysOfShapedJson (const v8::AccessorInfo& info) {
}
}
TRI_v8_global_t* v8g = (TRI_v8_global_t*) v8::Isolate::GetCurrent()->GetData();
TRI_v8_global_t* v8g = static_cast<TRI_v8_global_t*>(v8::Isolate::GetCurrent()->GetData());
result->Set(count++, v8g->_IdKey);
result->Set(count++, v8g->_RevKey);
result->Set(count++, v8g->_KeyKey);
@ -10038,7 +10048,7 @@ static v8::Handle<v8::Integer> PropertyQueryShapedJson (v8::Local<v8::String> na
}
if (key[0] == '_') {
if (key == "_id" || key == TRI_VOC_ATTRIBUTE_REV || key == TRI_VOC_ATTRIBUTE_KEY) {
if (key == "_key" || key == "_rev" || key == "_id" || key == "_from" || key == "_to") {
return scope.Close(v8::Handle<v8::Integer>(v8::Integer::New(v8::ReadOnly)));
}
}
@ -10069,7 +10079,7 @@ static v8::Handle<v8::Integer> PropertyQueryShapedJson (v8::Local<v8::String> na
TRI_shape_access_t const* acc = TRI_FindAccessorVocShaper(shaper, sid, pid);
// key not found
if (acc == 0 || acc->_resultSid == TRI_SHAPE_ILLEGAL) {
if (acc == nullptr || acc->_resultSid == TRI_SHAPE_ILLEGAL) {
return scope.Close(v8::Handle<v8::Integer>());
}
@ -10172,7 +10182,7 @@ TRI_index_t* TRI_LookupIndexByHandle (CollectionNameResolver const* resolver,
// extract the index identifier from an object
else if (val->IsObject()) {
TRI_v8_global_t* v8g = (TRI_v8_global_t*) v8::Isolate::GetCurrent()->GetData();
TRI_v8_global_t* v8g = static_cast<TRI_v8_global_t*>(v8::Isolate::GetCurrent()->GetData());
v8::Handle<v8::Object> obj = val->ToObject();
v8::Handle<v8::Value> iidVal = obj->Get(v8g->IdKey);

View File

@ -186,7 +186,7 @@ function post_api_aqlfunction (req, res) {
/// @startDocuBlock JSF_delete_api_aqlfunction
/// @brief remove an existing AQL user function
///
/// @RESTHEADER{DELETE /_api/aqlfunction/name, Remove existing AQL user function}
/// @RESTHEADER{DELETE /_api/aqlfunction/{name}, Remove existing AQL user function}
///
/// @RESTURLPARAMETERS
///

View File

@ -379,7 +379,7 @@ function post_api_cursor(req, res) {
/// @startDocuBlock JSF_post_api_cursor_identifier
/// @brief return the next results from an existing cursor
///
/// @RESTHEADER{PUT /_api/cursor/cursor-identifier, Read next batch from cursor}
/// @RESTHEADER{PUT /_api/cursor/{cursor-identifier}, Read next batch from cursor}
///
/// @RESTURLPARAMETERS
///
@ -501,7 +501,7 @@ function put_api_cursor (req, res) {
/// @startDocuBlock JSF_post_api_cursor_delete
/// @brief dispose an existing cursor
///
/// @RESTHEADER{DELETE /_api/cursor/cursor-identifier, Delete cursor}
/// @RESTHEADER{DELETE /_api/cursor/{cursor-identifier}, Delete cursor}
///
/// @RESTURLPARAMETERS
///

View File

@ -397,7 +397,7 @@ function post_api_database (req, res) {
/// @startDocuBlock JSF_get_api_database_delete
/// @brief drop an existing database
///
/// @RESTHEADER{DELETE /_api/database/database-name, Drop database}
/// @RESTHEADER{DELETE /_api/database/{database-name}, Drop database}
///
/// @RESTURLPARAMETERS
///

View File

@ -42,7 +42,7 @@ var API = "/_api/edges";
/// @startDocuBlock API_EDGE_READINOUTBOUND
/// @brief get edges
///
/// @RESTHEADER{GET /_api/edges/collection-id, Read in- or outbound edges}
/// @RESTHEADER{GET /_api/edges/{collection-id}, Read in- or outbound edges}
///
/// @RESTURLPARAMETERS
///

View File

@ -1223,13 +1223,16 @@ function post_graph_all_vertices (req, res, g) {
////////////////////////////////////////////////////////////////////////////////
/// @brief get neighbors of a vertex
///
/// @RESTHEADER{POST /_api/graph/`graph-name`/vertices/`vertice-name`,get vertices}
/// @RESTHEADER{POST /_api/graph/`graph-name`/vertices/`vertex-name`,get vertices}
///
/// @RESTURLPARAMETERS
///
/// @RESTURLPARAM{graph-name,string,required}
/// The name of the graph
///
/// @RESTURLPARAM{vertex-name,string,required}
/// The key of the vertex
///
/// @RESTBODYPARAM{graph,json,required}
/// The call expects a JSON hash array as body to filter the result:
///

View File

@ -1,6 +1,6 @@
{
"swaggerVersion": "1.1",
"apiVersion": "2.0.0-rc1",
"apiVersion": "2.2.0",
"apis": [
{
"path": "api-docs/aqlfunction.{format}",

View File

@ -22,10 +22,10 @@
}
],
"notes": "Returns all registered AQL user functions. <br><br> The call will return a JSON list with all user functions found. Each user function will at least have the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>name</em>: The fully qualified name of the user function <li><em>code</em>: A string representation of the function body",
"summary": "returns registered AQL user functions",
"summary": " Return registered AQL user functions",
"httpMethod": "GET",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/aqlfunction\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n[ ]\n\n</code></pre><br>",
"nickname": "returnsRegisteredAqlUserFunctions"
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/aqlfunction\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n[ ]\n</code></pre><br>@endDocuBlock",
"nickname": "ReturnRegisteredAqlUserFunctions"
}
],
"path": "/_api/aqlfunction"
@ -57,10 +57,10 @@
}
],
"notes": "<br><br> The following data need to be passed in a JSON representation in the body of the POST request: <br><br> <ul class=\"swagger-list\"><li><em>name</em>: the fully qualified name of the user functions. <li><em>code</em>: a string representation of the function body. <li><em>isDeterministic</em>: an optional boolean value to indicate that the function results are fully deterministic (function return value solely depends on the input value and return value is the same for repeated calls with same input). The <em>isDeterministic</em> attribute is currently not used but may be used later for optimisations. </ul> In case of success, the returned JSON object has the following properties: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>false</em> in this case) <li><em>code</em>: the HTTP status code </ul> The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case) <li><em>code</em>: the HTTP status code <li><em>errorNum</em>: the server error number <li><em>errorMessage</em>: a descriptive error message",
"summary": "creates or replaces an AQL user function",
"summary": " Create AQL user function",
"httpMethod": "POST",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/aqlfunction\n{ \"name\" : \"myfunctions::temperature::celsiustofahrenheit\", \"code\" : \"function (celsius) { return celsius * 1.8 + 32; }\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"nickname": "createsOrReplacesAnAqlUserFunction"
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/aqlfunction\n{ \"name\" : \"myfunctions::temperature::celsiustofahrenheit\", \"code\" : \"function (celsius) { return celsius * 1.8 + 32; }\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "CreateAqlUserFunction"
}
],
"path": "/_api/aqlfunction"
@ -99,10 +99,10 @@
}
],
"notes": "<br><br> Removes an existing AQL user function, identified by <em>name</em>. <br><br> In case of success, the returned JSON object has the following properties: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>false</em> in this case) <li><em>code</em>: the HTTP status code </ul> The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case) <li><em>code</em>: the HTTP status code <li><em>errorNum</em>: the server error number <li><em>errorMessage</em>: a descriptive error message",
"summary": "remove an existing AQL user function",
"summary": " Remove existing AQL user function",
"httpMethod": "DELETE",
"examples": "<br><br> deletes a function: <br><br><br><br><pre><code class=\"json\">unix> curl -X DELETE --dump - http://localhost:8529/_api/aqlfunction/square::x::y\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br> function not found: <br><br><br><br><pre><code class=\"json\">unix> curl -X DELETE --dump - http://localhost:8529/_api/aqlfunction/myfunction::x::y\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 1582, \n \"errorMessage\" : \"user function '%s()' not found\" \n}\n\n</code></pre><br>",
"nickname": "removeAnExistingAqlUserFunction"
"examples": "<br><br> deletes a function: <br><br><br><br><pre><code class=\"json\">shell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/aqlfunction/square::x::y\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br> function not found: <br><br><br><br><pre><code class=\"json\">shell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/aqlfunction/myfunction::x::y\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 1582, \n \"errorMessage\" : \"user function '%s()' not found\" \n}\n</code></pre><br>@endDocuBlock",
"nickname": "RemoveExistingAqlUserFunction"
}
],
"path": "/_api/aqlfunction/{name}"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -33,11 +33,11 @@
"description": "A JSON object describing the query and query parameters. <br><br>"
}
],
"notes": "The query details include the query string plus optional query options and bind parameters. These values need to be passed in a JSON representation in the body of the POST request. <br><br> The following attributes can be used inside the JSON object: <br><br> <ul class=\"swagger-list\"><li><em>query</em>: contains the query string to be executed (mandatory) <li><em>count</em>: boolean flag that indicates whether the number of documents in the result set should be returned in the \"count\" attribute of the result (optional). Calculating the \"count\" attribute might in the future have a performance impact for some queries so this option is turned off by default, and \"count\" is only returned when requested. <li><em>batchSize</em>: maximum number of result documents to be transferred from the server to the client in one roundtrip (optional). If this attribute is not set, a server-controlled default value will be used. <li><em>bindVars</em>: key/value list of bind parameters (optional). <li><em>options</em>: key/value list of extra options for the query (optional). </ul> The following options are supported at the moment: <br><br> <ul class=\"swagger-list\"><li><em>fullCount</em>: if set to <em>true</em> and the query contains a <em>LIMIT</em> clause, then the result will contain an extra attribute <em>extra</em> with a sub-attribute <em>fullCount</em>. This sub-attribute will contain the number of documents in the result before the last LIMIT in the query was applied. It can be used to count the number of documents that match certain filter criteria, but only return a subset of them, in one go. It is thus similar to MySQL's <em>SQL_CALC_FOUND_ROWS</em> hint. Note that setting the option will disable a few LIMIT optimisations and may lead to more documents being processed, and thus make queries run longer. Note that the <em>fullCount</em> sub-attribute will only be present in the result if the query has a LIMIT clause and the LIMIT clause is actually used in the query. </ul> If the result set can be created by the server, the server will respond with <em>HTTP 201</em>. The body of the response will contain a JSON object with the result set. <br><br> The returned JSON object has the following properties: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>false</em> in this case) <li><em>code</em>: the HTTP status code <li><em>result</em>: an array of result documents (might be empty if query has no results) <li><em>hasMore</em>: a boolean indicator whether there are more results available for the cursor on the server <li><em>count</em>: the total number of result documents available (only available if the query was executed with the <em>count</em> attribute set) <li><em>id</em>: id of temporary cursor created on the server (optional, see above) <li><em>extra</em>: an optional JSON object with extra information about the query result </ul> If the JSON representation is malformed or the query specification is missing from the request, the server will respond with <em>HTTP 400</em>. <br><br> The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case) <li><em>code</em>: the HTTP status code <li><em>errorNum</em>: the server error number <li><em>errorMessage</em>: a descriptive error message </ul> If the query specification is complete, the server will process the query. If an error occurs during query processing, the server will respond with <em>HTTP 400</em>. Again, the body of the response will contain details about the error. <br><br> A list of query errors can be found the manual here. <br><br>",
"summary": "creates a cursor",
"notes": "The query details include the query string plus optional query options and bind parameters. These values need to be passed in a JSON representation in the body of the POST request. <br><br> The following attributes can be used inside the JSON object: <br><br> <ul class=\"swagger-list\"><li><em>query</em>: contains the query string to be executed (mandatory) <li><em>count</em>: boolean flag that indicates whether the number of documents in the result set should be returned in the \"count\" attribute of the result (optional). Calculating the \"count\" attribute might in the future have a performance impact for some queries so this option is turned off by default, and \"count\" is only returned when requested. <li><em>batchSize</em>: maximum number of result documents to be transferred from the server to the client in one roundtrip (optional). If this attribute is not set, a server-controlled default value will be used. <li><em>ttl</em>: an optional time-to-live for the cursor (in seconds). The cursor will be removed on the server automatically after the specified amount of time. This is useful to ensure garbage collection of cursors that are not fully fetched by clients. If not set, a server-defined value will be used. <li><em>bindVars</em>: key/value list of bind parameters (optional). <li><em>options</em>: key/value list of extra options for the query (optional). </ul> The following options are supported at the moment: <br><br> <ul class=\"swagger-list\"><li><em>fullCount</em>: if set to <em>true</em> and the query contains a <em>LIMIT</em> clause, then the result will contain an extra attribute <em>extra</em> with a sub-attribute <em>fullCount</em>. This sub-attribute will contain the number of documents in the result before the last LIMIT in the query was applied. It can be used to count the number of documents that match certain filter criteria, but only return a subset of them, in one go. It is thus similar to MySQL's <em>SQL_CALC_FOUND_ROWS</em> hint. Note that setting the option will disable a few LIMIT optimizations and may lead to more documents being processed, and thus make queries run longer. Note that the <em>fullCount</em> sub-attribute will only be present in the result if the query has a LIMIT clause and the LIMIT clause is actually used in the query. </ul> If the result set can be created by the server, the server will respond with <em>HTTP 201</em>. The body of the response will contain a JSON object with the result set. <br><br> The returned JSON object has the following properties: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>false</em> in this case) <li><em>code</em>: the HTTP status code <li><em>result</em>: an array of result documents (might be empty if query has no results) <li><em>hasMore</em>: a boolean indicator whether there are more results available for the cursor on the server <li><em>count</em>: the total number of result documents available (only available if the query was executed with the <em>count</em> attribute set) <li><em>id</em>: id of temporary cursor created on the server (optional, see above) <li><em>extra</em>: an optional JSON object with extra information about the query result. For data-modification queries, the <em>extra</em> attribute will contain the number of modified documents and the number of documents that could not be modified due to an error (if <em>ignoreErrors</em> query option is specified) </ul> If the JSON representation is malformed or the query specification is missing from the request, the server will respond with <em>HTTP 400</em>. <br><br> The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case) <li><em>code</em>: the HTTP status code <li><em>errorNum</em>: the server error number <li><em>errorMessage</em>: a descriptive error message </ul> If the query specification is complete, the server will process the query. If an error occurs during query processing, the server will respond with <em>HTTP 400</em>. Again, the body of the response will contain details about the error. <br><br> A list of query errors can be found (../ArangoErrors/README.md) here. <br><br>",
"summary": " Create cursor",
"httpMethod": "POST",
"examples": "<br><br> Executes a query and extract the result in a single go: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR p IN products LIMIT 2 RETURN p\",\"count\":true,\"batchSize\":2}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/65749415\", \n \"_rev\" : \"65749415\", \n \"_key\" : \"65749415\", \n \"hello1\" : \"world1\" \n }, \n { \n \"_id\" : \"products/66077095\", \n \"_rev\" : \"66077095\", \n \"_key\" : \"66077095\", \n \"hello2\" : \"world1\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br><br><br> Executes a query and extracts part of the result: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR p IN products LIMIT 5 RETURN p\",\"count\":true,\"batchSize\":2}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/66929063\", \n \"_rev\" : \"66929063\", \n \"_key\" : \"66929063\", \n \"hello2\" : \"world1\" \n }, \n { \n \"_id\" : \"products/67584423\", \n \"_rev\" : \"67584423\", \n \"_key\" : \"67584423\", \n \"hello4\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"68108711\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br><br><br> Using a query option: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR i IN 1..1000 FILTER i > 500 LIMIT 10 RETURN i\",\"count\":true,\"options\":{\"fullCount\":true}}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n 501, \n 502, \n 503, \n 504, \n 505, \n 506, \n 507, \n 508, \n 509, \n 510 \n ], \n \"hasMore\" : false, \n \"count\" : 10, \n \"extra\" : { \n \"fullCount\" : 500 \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br><br><br> Bad queries: <br><br> Missing body: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --dump - http://localhost:8529/_api/cursor\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1502, \n \"errorMessage\" : \"query is empty\" \n}\n\n</code></pre><br><br><br> Unknown collection: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR u IN unknowncoll LIMIT 2 RETURN u\",\"count\":true,\"batchSize\":2}\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 1203, \n \"errorMessage\" : \"cannot execute query: collection not found: 'unknowncoll'\" \n}\n\n</code></pre><br>",
"nickname": "createsACursor"
"examples": "<br><br> Executes a query and extract the result in a single go: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR p IN products LIMIT 2 RETURN p\",\"count\":true,\"batchSize\":2}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/835657222\", \n \"_rev\" : \"835657222\", \n \"_key\" : \"835657222\", \n \"hello1\" : \"world1\" \n }, \n { \n \"_id\" : \"products/835984902\", \n \"_rev\" : \"835984902\", \n \"_key\" : \"835984902\", \n \"hello2\" : \"world1\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br> Executes a query and extracts part of the result: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR p IN products LIMIT 5 RETURN p\",\"count\":true,\"batchSize\":2}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/837885446\", \n \"_rev\" : \"837885446\", \n \"_key\" : \"837885446\", \n \"hello5\" : \"world1\" \n }, \n { \n \"_id\" : \"products/836902406\", \n \"_rev\" : \"836902406\", \n \"_key\" : \"836902406\", \n \"hello2\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"838082054\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br> Using a query option: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR i IN 1..1000 FILTER i > 500 LIMIT 10 RETURN i\",\"count\":true,\"options\":{\"fullCount\":true}}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n 501, \n 502, \n 503, \n 504, \n 505, \n 506, \n 507, \n 508, \n 509, \n 510 \n ], \n \"hasMore\" : false, \n \"count\" : 10, \n \"extra\" : { \n \"fullCount\" : 500 \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br> Executes a data-modification query and retrieves the number of modified documents: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR p IN products REMOVE p IN products\"}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ ], \n \"hasMore\" : false, \n \"extra\" : { \n \"operations\" : { \n \"executed\" : 2, \n \"ignored\" : 0 \n } \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br> Executes a data-modification query with option <em>ignoreErrors</em>: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"REMOVE 'bar' IN products OPTIONS { ignoreErrors: true }\"}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ ], \n \"hasMore\" : false, \n \"extra\" : { \n \"operations\" : { \n \"executed\" : 0, \n \"ignored\" : 1 \n } \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br> Bad queries: <br><br> Missing body: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --dump - http://localhost:8529/_api/cursor\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1502, \n \"errorMessage\" : \"query is empty\" \n}\n</code></pre><br><br><br> Unknown collection: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR u IN unknowncoll LIMIT 2 RETURN u\",\"count\":true,\"batchSize\":2}\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 1203, \n \"errorMessage\" : \"cannot execute query: collection not found: 'unknowncoll'\" \n}\n</code></pre><br><br><br> Executes a data-modification query that attempts to remove a non-existing document: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"REMOVE 'foo' IN products\"}\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 1202, \n \"errorMessage\" : \"document not found\" \n}\n</code></pre><br><br><br> @endDocuBlock",
"nickname": "CreateCursor"
}
],
"path": "/_api/cursor"
@ -51,7 +51,7 @@
"code": "200"
},
{
"reason": "If the cursor identifier is ommitted, the server will respond with <em>HTTP 404</em>. <br><br>",
"reason": "If the cursor identifier is omitted, the server will respond with <em>HTTP 404</em>. <br><br>",
"code": "400"
},
{
@ -69,10 +69,10 @@
}
],
"notes": "<br><br> If the cursor is still alive, returns an object with the following attributes. <br><br> <ul class=\"swagger-list\"><li><em>id</em>: the <em>cursor-identifier</em> <li><em>result</em>: a list of documents for the current batch <li><em>hasMore</em>: <em>false</em> if this was the last batch <li><em>count</em>: if present the total number of elements </ul> Note that even if <em>hasMore</em> returns <em>true</em>, the next call might still return no documents. If, however, <em>hasMore</em> is <em>false</em>, then the cursor is exhausted. Once the <em>hasMore</em> attribute has a value of <em>false</em>, the client can stop. <br><br>",
"summary": "reads next batch from a cursor",
"summary": " Read next batch from cursor",
"httpMethod": "PUT",
"examples": "<br><br> Valid request for next batch: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR p IN products LIMIT 5 RETURN p\",\"count\":true,\"batchSize\":2}\n\nunix> curl -X PUT --dump - http://localhost:8529/_api/cursor/70074791\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/69222823\", \n \"_rev\" : \"69222823\", \n \"_key\" : \"69222823\", \n \"hello3\" : \"world1\" \n }, \n { \n \"_id\" : \"products/68567463\", \n \"_rev\" : \"68567463\", \n \"_key\" : \"68567463\", \n \"hello1\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"70074791\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br> Missing identifier <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --dump - http://localhost:8529/_api/cursor\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 400, \n \"errorMessage\" : \"bad parameter\" \n}\n\n</code></pre><br><br><br> Unknown identifier <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --dump - http://localhost:8529/_api/cursor/123123\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 1600, \n \"errorMessage\" : \"cursor not found\" \n}\n\n</code></pre><br>",
"nickname": "readsNextBatchFromACursor"
"examples": "<br><br> Valid request for next batch: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR p IN products LIMIT 5 RETURN p\",\"count\":true,\"batchSize\":2}\n\nshell> curl -X PUT --dump - http://localhost:8529/_api/cursor/842866182\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/841686534\", \n \"_rev\" : \"841686534\", \n \"_key\" : \"841686534\", \n \"hello2\" : \"world1\" \n }, \n { \n \"_id\" : \"products/841358854\", \n \"_rev\" : \"841358854\", \n \"_key\" : \"841358854\", \n \"hello1\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"842866182\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br> Missing identifier <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --dump - http://localhost:8529/_api/cursor\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 400, \n \"errorMessage\" : \"bad parameter\" \n}\n</code></pre><br><br><br> Unknown identifier <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --dump - http://localhost:8529/_api/cursor/123123\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 1600, \n \"errorMessage\" : \"cursor not found\" \n}\n</code></pre><br>@endDocuBlock",
"nickname": "ReadNextBatchFromCursor"
}
],
"path": "/_api/cursor/{cursor-identifier}"
@ -100,10 +100,10 @@
}
],
"notes": "Deletes the cursor and frees the resources associated with it. <br><br> The cursor will automatically be destroyed on the server when the client has retrieved all documents from it. The client can also explicitly destroy the cursor at any earlier time using an HTTP DELETE request. The cursor id must be included as part of the URL. <br><br> Note: the server will also destroy abandoned cursors automatically after a certain server-controlled timeout to avoid resource leakage. <br><br>",
"summary": "deletes a cursor",
"summary": " Delete cursor",
"httpMethod": "DELETE",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR p IN products LIMIT 5 RETURN p\",\"count\":true,\"batchSize\":2}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/70795687\", \n \"_rev\" : \"70795687\", \n \"_key\" : \"70795687\", \n \"hello2\" : \"world1\" \n }, \n { \n \"_id\" : \"products/71123367\", \n \"_rev\" : \"71123367\", \n \"_key\" : \"71123367\", \n \"hello3\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"71975335\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 201 \n}\n\nunix> curl -X DELETE --dump - http://localhost:8529/_api/cursor/71975335\n\n</code></pre><br>",
"nickname": "deletesACursor"
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR p IN products LIMIT 5 RETURN p\",\"count\":true,\"batchSize\":2}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/843980294\", \n \"_rev\" : \"843980294\", \n \"_key\" : \"843980294\", \n \"hello3\" : \"world1\" \n }, \n { \n \"_id\" : \"products/844307974\", \n \"_rev\" : \"844307974\", \n \"_key\" : \"844307974\", \n \"hello4\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"844832262\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 201 \n}\nshell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/cursor/844832262\n\n</code></pre><br>@endDocuBlock",
"nickname": "DeleteCursor"
}
],
"path": "/_api/cursor/{cursor-identifier}"

View File

@ -21,11 +21,11 @@
}
],
"parameters": [],
"notes": "Retrieves the list of all existing databases <br><br> Note: retrieving the list of databases is only possible from within the <em>_system</em> database. <br><br>",
"summary": "retrieves a list of all existing databases",
"notes": "Retrieves the list of all existing databases <br><br> <em>*Note*</em>: retrieving the list of databases is only possible from within the <em>_system</em> database. <br><br>",
"summary": " List of databases",
"httpMethod": "GET",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/database\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n \"_system\" \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "retrievesAListOfAllExistingDatabases"
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/database\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n \"_system\" \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "ListOfDatabases"
}
],
"path": "/_api/database"
@ -45,10 +45,10 @@
],
"parameters": [],
"notes": "Retrieves the list of all databases the current user can access without specifying a different username or password. <br><br>",
"summary": "retrieves a list of all databases the current user can access",
"summary": " List of accessible databases ",
"httpMethod": "GET",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/database/user\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n \"_system\" \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "retrievesAListOfAllDatabasesTheCurrentUserCanAccess"
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/database/user\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n \"_system\" \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "ListOfAccessibleDatabases"
}
],
"path": "/_api/database/user"
@ -72,10 +72,10 @@
],
"parameters": [],
"notes": "Retrieves information about the current database <br><br> The response is a JSON object with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>name</em>: the name of the current database <li><em>id</em>: the id of the current database <li><em>path</em>: the filesystem path of the current database <li><em>isSystem</em>: whether or not the current database is the <em>_system</em> database",
"summary": "retrieves information about the current database",
"summary": " Information of the database",
"httpMethod": "GET",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/database/current\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"name\" : \"_system\", \n \"id\" : \"82343\", \n \"path\" : \"/tmp/vocdir.75134/databases/database-82343\", \n \"isSystem\" : true \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "retrievesInformationAboutTheCurrentDatabase"
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/database/current\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"name\" : \"_system\", \n \"id\" : \"73222\", \n \"path\" : \"/tmp/vocdir.92357/databases/database-73222\", \n \"isSystem\" : true \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "InformationOfTheDatabase"
}
],
"path": "/_api/database/current"
@ -110,11 +110,11 @@
"description": "the body with the name of the database. <br><br>"
}
],
"notes": "Creates a new database <br><br> The request body must be a JSON object with the attribute <em>name</em>. <em>name</em> must contain a valid the manual \"database name\". <br><br> The request body can optionally contain an attribute <em>users</em>, which then must be a list of user objects to initially create for the new database. Each user object can contain the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>username</em>: the user name as a string. This attribute is mandatory. <li><em>passwd</em>: the user password as a string. If not specified, then it defaults to the empty string. <li><em>active</em>: a boolean flag indicating whether the user accout should be actived or not. The default value is <em>true</em>. <li><em>extra</em>: an optional JSON object with extra user information. The data contained in <em>extra</em> will be stored for the user but not be interpreted further by ArangoDB. </ul> If <em>users</em> is not specified or does not contain any users, a default user <em>root</em> will be created with an empty string password. This ensures that the new database will be accessible after it is created. <br><br> The response is a JSON object with the attribute <em>result</em> set to <em>true</em>. <br><br> Note: creating a new database is only possible from within the <em>_system</em> database. <br><br>",
"summary": "creates a new database",
"notes": "Creates a new database <br><br> The request body must be a JSON object with the attribute <em>name</em>. <em>name</em> must contain a valid database name. <br><br> The request body can optionally contain an attribute <em>users</em>, which then must be a list of user objects to initially create for the new database. Each user object can contain the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>username</em>: the user name as a string. This attribute is mandatory. <li><em>passwd</em>: the user password as a string. If not specified, then it defaults to the empty string. <li><em>active</em>: a boolean flag indicating whether the user accout should be actived or not. The default value is <em>true</em>. <li><em>extra</em>: an optional JSON object with extra user information. The data contained in <em>extra</em> will be stored for the user but not be interpreted further by ArangoDB. </ul> If <em>users</em> is not specified or does not contain any users, a default user <em>root</em> will be created with an empty string password. This ensures that the new database will be accessible after it is created. <br><br> The response is a JSON object with the attribute <em>result</em> set to <em>true</em>. <br><br> <em>*Note*</em>: creating a new database is only possible from within the <em>_system</em> database. <br><br>",
"summary": " Create database",
"httpMethod": "POST",
"examples": "<br><br> Creating a database named <em>example</em>. <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/database\n{\"name\":\"example\"}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br><br><br> Creating a database named <em>mydb</em> with two users. <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/database\n{\"name\":\"mydb\",\"users\":[{\"username\":\"admin\",\"passwd\":\"secret\",\"active\":true},{\"username\":\"tester\",\"passwd\":\"test001\",\"active\":false}]}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"nickname": "createsANewDatabase"
"examples": "<br><br> Creating a database named <em>example</em>. <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/database\n{\"name\":\"example\"}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br> Creating a database named <em>mydb</em> with two users. <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/database\n{\"name\":\"mydb\",\"users\":[{\"username\":\"admin\",\"passwd\":\"secret\",\"active\":true},{\"username\":\"tester\",\"passwd\":\"test001\",\"active\":false}]}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "CreateDatabase"
}
],
"path": "/_api/database"
@ -149,11 +149,11 @@
"description": "The name of the database <br><br>"
}
],
"notes": "Deletes the database along with all data stored in it. <br><br> Note: dropping a database is only possible from within the <em>_system</em> database. The <em>_system</em> database itself cannot be dropped. <br><br>",
"summary": "drops an existing database",
"notes": "Deletes the database along with all data stored in it. <br><br> <em>*Note*</em>: dropping a database is only possible from within the <em>_system</em> database. The <em>_system</em> database itself cannot be dropped. <br><br>",
"summary": " Drop database",
"httpMethod": "DELETE",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X DELETE --dump - http://localhost:8529/_api/database/example\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "dropsAnExistingDatabase"
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/database/example\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "DropDatabase"
}
],
"path": "/_api/database/{database-name}"

View File

@ -44,7 +44,7 @@
"paramType": "query",
"required": "false",
"name": "createCollection",
"description": "If this parameter has a value of <em>true</em> or <em>yes</em>, 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. <br><br> Note: this flag is not supported in a cluster. Using it will result in an error. <br><br>"
"description": "If this parameter has a value of <em>true</em> or <em>yes</em>, 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. <br><br> <em>*Note*</em>: this flag is not supported in a cluster. Using it will result in an error. <br><br>"
},
{
"dataType": "Boolean",
@ -55,10 +55,10 @@
}
],
"notes": "Creates a new document in the collection named <em>collection</em>. A JSON representation of the document must be passed as the body of the POST request. <br><br> 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. <br><br> The body of the response contains a JSON object with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>_id</em> contains the document handle of the newly created document <li><em>_key</em> contains the document key <li><em>_rev</em> contains the document revision </ul> If the collection parameter <em>waitForSync</em> is <em>false</em>, then the call returns as soon as the document has been accepted. It will not wait until the document has been synced to disk. <br><br> Optionally, the URL parameter <em>waitForSync</em> can be used to force synchronisation of the document creation operation to disk even in case that the <em>waitForSync</em> flag had been disabled for the entire collection. Thus, the <em>waitForSync</em> URL parameter can be used to force synchronisation of just this specific operations. To use this, set the <em>waitForSync</em> parameter to <em>true</em>. If the <em>waitForSync</em> parameter is not specified or set to <em>false</em>, then the collection's default <em>waitForSync</em> behavior is applied. The <em>waitForSync</em> URL parameter cannot be used to disable synchronisation for collections that have a default <em>waitForSync</em> value of <em>true</em>. <br><br>",
"summary": "creates a document",
"summary": "Create document",
"httpMethod": "POST",
"examples": "<br><br> Create a document given a collection named <em>products</em>. Note that the revision identifier might or might not by equal to the auto-generated key. <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/document?collection=products\n{ \"Hello\": \"World\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\netag: \"294470055\"\nlocation: /_db/_system/_api/document/products/294470055\n\n{ \n \"error\" : false, \n \"_id\" : \"products/294470055\", \n \"_rev\" : \"294470055\", \n \"_key\" : \"294470055\" \n}\n\n</code></pre><br><br><br> Create a document in a collection named <em>products</em> with a collection-level <em>waitForSync</em> value of <em>false</em>. <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/document?collection=products\n{ \"Hello\": \"World\" }\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"294928807\"\nlocation: /_db/_system/_api/document/products/294928807\n\n{ \n \"error\" : false, \n \"_id\" : \"products/294928807\", \n \"_rev\" : \"294928807\", \n \"_key\" : \"294928807\" \n}\n\n</code></pre><br><br><br> Create a document in a collection with a collection-level <em>waitForSync</em> value of <em>false</em>, but using the <em>waitForSync</em> URL parameter. <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/document?collection=products&waitForSync=true\n{ \"Hello\": \"World\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\netag: \"295387559\"\nlocation: /_db/_system/_api/document/products/295387559\n\n{ \n \"error\" : false, \n \"_id\" : \"products/295387559\", \n \"_rev\" : \"295387559\", \n \"_key\" : \"295387559\" \n}\n\n</code></pre><br><br><br> Create a document in a new, named collection <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/document?collection=products&createCollection=true\n{ \"Hello\": \"World\" }\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"295846311\"\nlocation: /_db/_system/_api/document/products/295846311\n\n{ \n \"error\" : false, \n \"_id\" : \"products/295846311\", \n \"_rev\" : \"295846311\", \n \"_key\" : \"295846311\" \n}\n\n</code></pre><br><br><br> Unknown collection name: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/document?collection=products\n{ \"Hello\": \"World\" }\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"collection 'products' not found\", \n \"code\" : 404, \n \"errorNum\" : 1203 \n}\n\n</code></pre><br><br><br> Illegal document: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/document?collection=products\n{ 1: \"World\" }\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"expecting attribute name\", \n \"code\" : 400, \n \"errorNum\" : 600 \n}\n\n</code></pre><br>",
"nickname": "createsADocument"
"examples": "<br><br> Create a document given a collection named <em>products</em>. Note that the revision identifier might or might not by equal to the auto-generated key. <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/document?collection=products\n{ \"Hello\": \"World\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\netag: \"1216552454\"\nlocation: /_db/_system/_api/document/products/1216552454\n\n{ \n \"error\" : false, \n \"_id\" : \"products/1216552454\", \n \"_rev\" : \"1216552454\", \n \"_key\" : \"1216552454\" \n}\n</code></pre><br><br><br> Create a document in a collection named <em>products</em> with a collection-level <em>waitForSync</em> value of <em>false</em>. <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/document?collection=products\n{ \"Hello\": \"World\" }\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"1217076742\"\nlocation: /_db/_system/_api/document/products/1217076742\n\n{ \n \"error\" : false, \n \"_id\" : \"products/1217076742\", \n \"_rev\" : \"1217076742\", \n \"_key\" : \"1217076742\" \n}\n</code></pre><br><br><br> Create a document in a collection with a collection-level <em>waitForSync</em> value of <em>false</em>, but using the <em>waitForSync</em> URL parameter. <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/document?collection=products&waitForSync=true\n{ \"Hello\": \"World\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\netag: \"1217601030\"\nlocation: /_db/_system/_api/document/products/1217601030\n\n{ \n \"error\" : false, \n \"_id\" : \"products/1217601030\", \n \"_rev\" : \"1217601030\", \n \"_key\" : \"1217601030\" \n}\n</code></pre><br><br><br> Create a document in a new, named collection <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/document?collection=products&createCollection=true\n{ \"Hello\": \"World\" }\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"1218125318\"\nlocation: /_db/_system/_api/document/products/1218125318\n\n{ \n \"error\" : false, \n \"_id\" : \"products/1218125318\", \n \"_rev\" : \"1218125318\", \n \"_key\" : \"1218125318\" \n}\n</code></pre><br><br><br> Unknown collection name: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/document?collection=products\n{ \"Hello\": \"World\" }\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"collection 'products' not found\", \n \"code\" : 404, \n \"errorNum\" : 1203 \n}\n</code></pre><br><br><br> Illegal document: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/document?collection=products\n{ 1: \"World\" }\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"expecting attribute name\", \n \"code\" : 400, \n \"errorNum\" : 600 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "CreateDocument"
}
],
"path": "/_api/document"
@ -106,10 +106,10 @@
}
],
"notes": "Returns the document identified by <em>document-handle</em>. The returned document contains two special attributes: <em>_id</em> containing the document handle and <em>_rev</em> containing the revision. <br><br>",
"summary": "reads a document",
"summary": "Read document",
"httpMethod": "GET",
"examples": "<br><br> Use a document handle: <br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/document/products/296305063\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"296305063\"\n\n{ \n \"hello\" : \"world\", \n \"_id\" : \"products/296305063\", \n \"_rev\" : \"296305063\", \n \"_key\" : \"296305063\" \n}\n\n</code></pre><br><br><br> Use a document handle and an etag: <br><br><br><br><pre><code class=\"json\">unix> curl --header 'If-None-Match: \"296829351\"' --dump - http://localhost:8529/_api/document/products/296829351\n\n</code></pre><br><br><br> Unknown document handle: <br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/document/products/unknownhandle\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"document /_api/document/products/unknownhandle not found\", \n \"code\" : 404, \n \"errorNum\" : 1202 \n}\n\n</code></pre><br>",
"nickname": "readsADocument"
"examples": "<br><br> Use a document handle: <br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/document/products/1218649606\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"1218649606\"\n\n{ \n \"hello\" : \"world\", \n \"_id\" : \"products/1218649606\", \n \"_rev\" : \"1218649606\", \n \"_key\" : \"1218649606\" \n}\n</code></pre><br><br><br> Use a document handle and an etag: <br><br><br><br><pre><code class=\"json\">shell> curl --header 'If-None-Match: \"1219239430\"' --dump - http://localhost:8529/_api/document/products/1219239430\n\n</code></pre><br><br><br> Unknown document handle: <br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/document/products/unknownhandle\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"document /_api/document/products/unknownhandle not found\", \n \"code\" : 404, \n \"errorNum\" : 1202 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "ReadDocument"
}
],
"path": "/_api/document/{document-handle}"
@ -137,10 +137,10 @@
}
],
"notes": "Returns a list of all URI for all documents from the collection identified by <em>collection</em>. <br><br>",
"summary": "reads all documents from collection",
"summary": "Read all documents",
"httpMethod": "GET",
"examples": "<br><br> Returns a all ids. <br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/document/?collection=products\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"documents\" : [ \n \"/_api/document/products/298074535\", \n \"/_api/document/products/297419175\", \n \"/_api/document/products/297746855\" \n ] \n}\n\n</code></pre><br><br><br> Collection does not exist. <br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/document/?collection=doesnotexist\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"collection 'doesnotexist' not found\", \n \"code\" : 404, \n \"errorNum\" : 1203 \n}\n\n</code></pre><br><br><br>",
"nickname": "readsAllDocumentsFromCollection"
"examples": "<br><br> Returns a all ids. <br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/document/?collection=products\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"documents\" : [ \n \"/_api/document/products/1220550150\", \n \"/_api/document/products/1220222470\", \n \"/_api/document/products/1219894790\" \n ] \n}\n</code></pre><br><br><br> Collection does not exist. <br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/document/?collection=doesnotexist\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"collection 'doesnotexist' not found\", \n \"code\" : 404, \n \"errorNum\" : 1203 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "ReadAllDocuments"
}
],
"path": "/_api/document"
@ -195,10 +195,10 @@
}
],
"notes": "Like <em>GET</em>, 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. <br><br>",
"summary": "reads a document header",
"summary": "Read document header",
"httpMethod": "HEAD",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X HEAD --dump - http://localhost:8529/_api/document/products/298598823\n\n</code></pre><br>",
"nickname": "readsADocumentHeader"
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl -X HEAD --data-binary @- --dump - http://localhost:8529/_api/document/products/1221139974\n\n</code></pre><br>@endDocuBlock @endDocuBlock",
"nickname": "ReadDocumentHeader"
}
],
"path": "/_api/document/{document-handle}"
@ -271,11 +271,11 @@
"description": "You can conditionally replace a document based on a target revision id by using the <em>if-match</em> HTTP header. <br><br>"
}
],
"notes": "Completely updates (i.e. replaces) the document identified by <em>document-handle</em>. If the document exists and can be updated, then a <em>HTTP 201</em> is returned and the \"ETag\" header field contains the new revision of the document. <br><br> If the new document passed in the body of the request contains the <em>document-handle</em> in the attribute <em>_id</em> and the revision in <em>_rev</em>, these attributes will be ignored. Only the URI and the \"ETag\" header are relevant in order to avoid confusion when using proxies. <br><br> Optionally, the URL parameter <em>waitForSync</em> can be used to force synchronisation of the document replacement operation to disk even in case that the <em>waitForSync</em> flag had been disabled for the entire collection. Thus, the <em>waitForSync</em> URL parameter can be used to force synchronisation of just specific operations. To use this, set the <em>waitForSync</em> parameter to <em>true</em>. If the <em>waitForSync</em> parameter is not specified or set to <em>false</em>, then the collection's default <em>waitForSync</em> behavior is applied. The <em>waitForSync</em> URL parameter cannot be used to disable synchronisation for collections that have a default <em>waitForSync</em> value of <em>true</em>. <br><br> The body of the response contains a JSON object with the information about the handle and the revision. The attribute <em>_id</em> contains the known <em>document-handle</em> of the updated document, the attribute <em>_rev</em> contains the new document revision. <br><br> If the document does not exist, then a <em>HTTP 404</em> is returned and the body of the response contains an error document. <br><br> 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): <ul class=\"swagger-list\"><li>specifying the target revision in the <em>rev</em> URL query parameter <li>specifying the target revision in the <em>if-match</em> HTTP header </ul> Specifying a target revision is optional, however, if done, only one of the described mechanisms must be used (either the <em>rev</em> URL parameter or the <em>if-match</em> HTTP header). Regardless which mechanism is used, the parameter needs to contain the target document revision id as returned in the <em>_rev</em> attribute of a document or by an HTTP <em>etag</em> header. <br><br> For example, to conditionally replace a document based on a specific revision id, you can use the following request: <br><br> <ul class=\"swagger-list\"><li>PUT /_api/document/<em>document-handle</em>?rev=<em>etag</em> </ul> If a target revision id is provided in the request (e.g. via the <em>etag</em> value in the <em>rev</em> 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 <em>HTTP 412</em> conflict is returned and no replacement is performed. <br><br> The conditional update behavior can be overriden with the <em>policy</em> URL query parameter: <br><br> <ul class=\"swagger-list\"><li>PUT /_api/document/<em>document-handle</em>?policy=<em>policy</em> </ul> If <em>policy</em> is set to <em>error</em>, 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. <br><br> If <em>policy</em> is set to <em>last</em>, 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 <em>last</em> `policy` to force replacements. <br><br>",
"summary": "replaces a document",
"notes": "Completely updates (i.e. replaces) the document identified by <em>document-handle</em>. If the document exists and can be updated, then a <em>HTTP 201</em> is returned and the \"ETag\" header field contains the new revision of the document. <br><br> If the new document passed in the body of the request contains the <em>document-handle</em> in the attribute <em>_id</em> and the revision in <em>_rev</em>, these attributes will be ignored. Only the URI and the \"ETag\" header are relevant in order to avoid confusion when using proxies. <br><br> Optionally, the URL parameter <em>waitForSync</em> can be used to force synchronisation of the document replacement operation to disk even in case that the <em>waitForSync</em> flag had been disabled for the entire collection. Thus, the <em>waitForSync</em> URL parameter can be used to force synchronisation of just specific operations. To use this, set the <em>waitForSync</em> parameter to <em>true</em>. If the <em>waitForSync</em> parameter is not specified or set to <em>false</em>, then the collection's default <em>waitForSync</em> behavior is applied. The <em>waitForSync</em> URL parameter cannot be used to disable synchronisation for collections that have a default <em>waitForSync</em> value of <em>true</em>. <br><br> The body of the response contains a JSON object with the information about the handle and the revision. The attribute <em>_id</em> contains the known <em>document-handle</em> of the updated document, the attribute <em>_rev</em> contains the new document revision. <br><br> If the document does not exist, then a <em>HTTP 404</em> is returned and the body of the response contains an error document. <br><br> 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): <ul class=\"swagger-list\"><li>specifying the target revision in the <em>rev</em> URL query parameter <li>specifying the target revision in the <em>if-match</em> HTTP header </ul> Specifying a target revision is optional, however, if done, only one of the described mechanisms must be used (either the <em>rev</em> URL parameter or the <em>if-match</em> HTTP header). Regardless which mechanism is used, the parameter needs to contain the target document revision id as returned in the <em>_rev</em> attribute of a document or by an HTTP <em>etag</em> header. <br><br> For example, to conditionally replace a document based on a specific revision id, you can use the following request: <br><br> <em>PUT /_api/document/document-handle?rev=etag</em> <br><br> If a target revision id is provided in the request (e.g. via the <em>etag</em> value in the <em>rev</em> 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 <em>HTTP 412</em> conflict is returned and no replacement is performed. <br><br> The conditional update behavior can be overriden with the <em>policy</em> URL query parameter: <br><br> <em>PUT /_api/document/document-handle?policy=policy</em> <br><br> If <em>policy</em> is set to <em>error</em>, 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. <br><br> If <em>policy</em> is set to <em>last</em>, 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 <em>last</em> *policy* to force replacements. <br><br>",
"summary": "Replace document",
"httpMethod": "PUT",
"examples": "<br><br> Using document handle: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/document/products/299123111\n{\"Hello\": \"you\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"299450791\"\nlocation: /_db/_system/_api/document/products/299123111\n\n{ \n \"error\" : false, \n \"_id\" : \"products/299123111\", \n \"_rev\" : \"299450791\", \n \"_key\" : \"299123111\" \n}\n\n</code></pre><br><br><br> Unknown document handle: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/document/products/299909543\n{}\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"document /_api/document/products/299909543 not found\", \n \"code\" : 404, \n \"errorNum\" : 1202 \n}\n\n</code></pre><br><br><br> Produce a revision conflict: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --header 'If-Match: \"301023655\"' --data-binary @- --dump - http://localhost:8529/_api/document/products/300695975\n{\"other\":\"content\"}\n\nHTTP/1.1 412 Precondition Failed\ncontent-type: application/json; charset=utf-8\netag: \"300695975\"\n\n{ \n \"error\" : true, \n \"code\" : 412, \n \"errorNum\" : 1200, \n \"errorMessage\" : \"precondition failed\", \n \"_id\" : \"products/300695975\", \n \"_rev\" : \"300695975\", \n \"_key\" : \"300695975\" \n}\n\n</code></pre><br><br><br> Last write wins: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --header 'If-Match: \"302006695\"' --data-binary @- --dump - http://localhost:8529/_api/document/products/301679015?policy=last\n{}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"302268839\"\nlocation: /_db/_system/_api/document/products/301679015\n\n{ \n \"error\" : false, \n \"_id\" : \"products/301679015\", \n \"_rev\" : \"302268839\", \n \"_key\" : \"301679015\" \n}\n\n</code></pre><br><br><br> Alternative to header field: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/document/products/302727591?rev=303055271\n{\"other\":\"content\"}\n\nHTTP/1.1 412 Precondition Failed\ncontent-type: application/json; charset=utf-8\netag: \"302727591\"\n\n{ \n \"error\" : true, \n \"code\" : 412, \n \"errorNum\" : 1200, \n \"errorMessage\" : \"precondition failed\", \n \"_id\" : \"products/302727591\", \n \"_rev\" : \"302727591\", \n \"_key\" : \"302727591\" \n}\n\n</code></pre><br>",
"nickname": "replacesADocument"
"examples": "<br><br> Using document handle: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/document/products/1221729798\n{\"Hello\": \"you\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"1222057478\"\nlocation: /_db/_system/_api/document/products/1221729798\n\n{ \n \"error\" : false, \n \"_id\" : \"products/1221729798\", \n \"_rev\" : \"1222057478\", \n \"_key\" : \"1221729798\" \n}\n</code></pre><br><br><br> Unknown document handle: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/document/products/1222581766\n{}\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"document /_api/document/products/1222581766 not found\", \n \"code\" : 404, \n \"errorNum\" : 1202 \n}\n</code></pre><br><br><br> Produce a revision conflict: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --header 'If-Match: \"1223826950\"' --data-binary @- --dump - http://localhost:8529/_api/document/products/1223499270\n{\"other\":\"content\"}\n\nHTTP/1.1 412 Precondition Failed\ncontent-type: application/json; charset=utf-8\netag: \"1223499270\"\n\n{ \n \"error\" : true, \n \"code\" : 412, \n \"errorNum\" : 1200, \n \"errorMessage\" : \"precondition failed\", \n \"_id\" : \"products/1223499270\", \n \"_rev\" : \"1223499270\", \n \"_key\" : \"1223499270\" \n}\n</code></pre><br><br><br> Last write wins: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --header 'If-Match: \"1224941062\"' --data-binary @- --dump - http://localhost:8529/_api/document/products/1224613382?policy=last\n{}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"1225203206\"\nlocation: /_db/_system/_api/document/products/1224613382\n\n{ \n \"error\" : false, \n \"_id\" : \"products/1224613382\", \n \"_rev\" : \"1225203206\", \n \"_key\" : \"1224613382\" \n}\n</code></pre><br><br><br> Alternative to header field: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/document/products/1225727494?rev=1226055174\n{\"other\":\"content\"}\n\nHTTP/1.1 412 Precondition Failed\ncontent-type: application/json; charset=utf-8\netag: \"1225727494\"\n\n{ \n \"error\" : true, \n \"code\" : 412, \n \"errorNum\" : 1200, \n \"errorMessage\" : \"precondition failed\", \n \"_id\" : \"products/1225727494\", \n \"_rev\" : \"1225727494\", \n \"_key\" : \"1225727494\" \n}\n</code></pre><br>@endDocuBlock",
"nickname": "ReplaceDocument"
}
],
"path": "/_api/document/{document-handle}"
@ -356,10 +356,10 @@
}
],
"notes": "Partially updates the document identified by <em>document-handle</em>. 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. <br><br> Setting an attribute value to <em>null</em> in the patch document will cause a value of <em>null</em> be saved for the attribute by default. <br><br> Optionally, the URL parameter <em>waitForSync</em> can be used to force synchronisation of the document update operation to disk even in case that the <em>waitForSync</em> flag had been disabled for the entire collection. Thus, the <em>waitForSync</em> URL parameter can be used to force synchronisation of just specific operations. To use this, set the <em>waitForSync</em> parameter to <em>true</em>. If the <em>waitForSync</em> parameter is not specified or set to <em>false</em>, then the collection's default <em>waitForSync</em> behavior is applied. The <em>waitForSync</em> URL parameter cannot be used to disable synchronisation for collections that have a default <em>waitForSync</em> value of <em>true</em>. <br><br> The body of the response contains a JSON object with the information about the handle and the revision. The attribute <em>_id</em> contains the known <em>document-handle</em> of the updated document, the attribute <em>_rev</em> contains the new document revision. <br><br> If the document does not exist, then a <em>HTTP 404</em> is returned and the body of the response contains an error document. <br><br> You can conditionally update a document based on a target revision id by using either the <em>rev</em> URL parameter or the <em>if-match</em> HTTP header. To control the update behavior in case there is a revision mismatch, you can use the <em>policy</em> parameter. This is the same as when replacing documents (see replacing documents for details). <br><br>",
"summary": "patches a document",
"summary": " Patch document",
"httpMethod": "PATCH",
"examples": "<br><br> patches an existing document with new content. <br><br><br><br><pre><code class=\"json\">unix> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/document/products/303710631\n{\"hello\":\"world\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"304038311\"\nlocation: /_db/_system/_api/document/products/303710631\n\n{ \n \"error\" : false, \n \"_id\" : \"products/303710631\", \n \"_rev\" : \"304038311\", \n \"_key\" : \"303710631\" \n}\n\nunix> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/document/products/303710631\n{\"numbers\":{\"one\":1,\"two\":2,\"three\":3,\"empty\":null}}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"304628135\"\nlocation: /_db/_system/_api/document/products/303710631\n\n{ \n \"error\" : false, \n \"_id\" : \"products/303710631\", \n \"_rev\" : \"304628135\", \n \"_key\" : \"303710631\" \n}\n\nunix> curl --dump - http://localhost:8529/_api/document/products/303710631\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"304628135\"\n\n{ \n \"one\" : \"world\", \n \"hello\" : \"world\", \n \"numbers\" : { \n \"empty\" : null, \n \"one\" : 1, \n \"two\" : 2, \n \"three\" : 3 \n }, \n \"_id\" : \"products/303710631\", \n \"_rev\" : \"304628135\", \n \"_key\" : \"303710631\" \n}\n\nunix> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/document/products/303710631?keepNull=false\n{\"hello\":null,\"numbers\":{\"four\":4}}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"305086887\"\nlocation: /_db/_system/_api/document/products/303710631\n\n{ \n \"error\" : false, \n \"_id\" : \"products/303710631\", \n \"_rev\" : \"305086887\", \n \"_key\" : \"303710631\" \n}\n\nunix> curl --dump - http://localhost:8529/_api/document/products/303710631\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"305086887\"\n\n{ \n \"one\" : \"world\", \n \"numbers\" : { \n \"empty\" : null, \n \"one\" : 1, \n \"two\" : 2, \n \"three\" : 3, \n \"four\" : 4 \n }, \n \"_id\" : \"products/303710631\", \n \"_rev\" : \"305086887\", \n \"_key\" : \"303710631\" \n}\n\n</code></pre><br>",
"nickname": "patchesADocument"
"examples": "<br><br> patches an existing document with new content. <br><br><br><br><pre><code class=\"json\">shell> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/document/products/1226841606\n{ \n \"hello\" : \"world\" \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"1227169286\"\nlocation: /_db/_system/_api/document/products/1226841606\n\n{ \n \"error\" : false, \n \"_id\" : \"products/1226841606\", \n \"_rev\" : \"1227169286\", \n \"_key\" : \"1226841606\" \n}\nshell> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/document/products/1226841606\n{ \n \"numbers\" : { \n \"one\" : 1, \n \"two\" : 2, \n \"three\" : 3, \n \"empty\" : null \n } \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"1227759110\"\nlocation: /_db/_system/_api/document/products/1226841606\n\n{ \n \"error\" : false, \n \"_id\" : \"products/1226841606\", \n \"_rev\" : \"1227759110\", \n \"_key\" : \"1226841606\" \n}\nshell> curl --data-binary @- --dump - http://localhost:8529/_api/document/products/1226841606\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"1227759110\"\n\n{ \n \"one\" : \"world\", \n \"hello\" : \"world\", \n \"numbers\" : { \n \"empty\" : null, \n \"one\" : 1, \n \"two\" : 2, \n \"three\" : 3 \n }, \n \"_id\" : \"products/1226841606\", \n \"_rev\" : \"1227759110\", \n \"_key\" : \"1226841606\" \n}\nshell> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/document/products/1226841606?keepNull=false\n{ \n \"hello\" : null, \n \"numbers\" : { \n \"four\" : 4 \n } \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"1228217862\"\nlocation: /_db/_system/_api/document/products/1226841606\n\n{ \n \"error\" : false, \n \"_id\" : \"products/1226841606\", \n \"_rev\" : \"1228217862\", \n \"_key\" : \"1226841606\" \n}\nshell> curl --data-binary @- --dump - http://localhost:8529/_api/document/products/1226841606\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"1228217862\"\n\n{ \n \"one\" : \"world\", \n \"numbers\" : { \n \"empty\" : null, \n \"one\" : 1, \n \"two\" : 2, \n \"three\" : 3, \n \"four\" : 4 \n }, \n \"_id\" : \"products/1226841606\", \n \"_rev\" : \"1228217862\", \n \"_key\" : \"1226841606\" \n}\n</code></pre><br>@endDocuBlock",
"nickname": "PatchDocument"
}
],
"path": "/_api/document/{document-handle}"
@ -422,10 +422,10 @@
}
],
"notes": "The body of the response contains a JSON object with the information about the handle and the revision. The attribute <em>_id</em> contains the known <em>document-handle</em> of the deleted document, the attribute <em>_rev</em> contains the document revision. <br><br> If the <em>waitForSync</em> parameter is not specified or set to <em>false</em>, then the collection's default <em>waitForSync</em> behavior is applied. The <em>waitForSync</em> URL parameter cannot be used to disable synchronisation for collections that have a default <em>waitForSync</em> value of <em>true</em>. <br><br>",
"summary": "deletes a document",
"summary": " Deletes document",
"httpMethod": "DELETE",
"examples": "<br><br> Using document handle: <br><br><br><br><pre><code class=\"json\">unix> curl -X DELETE --dump - http://localhost:8529/_api/document/products/305611175\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : false, \n \"_id\" : \"products/305611175\", \n \"_rev\" : \"305611175\", \n \"_key\" : \"305611175\" \n}\n\n</code></pre><br><br><br> Unknown document handle: <br><br><br><br><pre><code class=\"json\">unix> curl -X DELETE --dump - http://localhost:8529/_api/document/products/306266535\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"document /_api/document/products/306266535 not found\", \n \"code\" : 404, \n \"errorNum\" : 1202 \n}\n\n</code></pre><br><br><br> Revision conflict: <br><br><br><br><pre><code class=\"json\">unix> curl -X DELETE --header 'If-Match: \"307380647\"' --dump - http://localhost:8529/_api/document/products/307052967\n\nHTTP/1.1 412 Precondition Failed\ncontent-type: application/json; charset=utf-8\netag: \"307052967\"\n\n{ \n \"error\" : true, \n \"code\" : 412, \n \"errorNum\" : 1200, \n \"errorMessage\" : \"precondition failed\", \n \"_id\" : \"products/307052967\", \n \"_rev\" : \"307052967\", \n \"_key\" : \"307052967\" \n}\n\n</code></pre><br>",
"nickname": "deletesADocument"
"examples": "<br><br> Using document handle: <br><br><br><br><pre><code class=\"json\">shell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/document/products/1228807686\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : false, \n \"_id\" : \"products/1228807686\", \n \"_rev\" : \"1228807686\", \n \"_key\" : \"1228807686\" \n}\n</code></pre><br><br><br> Unknown document handle: <br><br><br><br><pre><code class=\"json\">shell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/document/products/1229528582\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"document /_api/document/products/1229528582 not found\", \n \"code\" : 404, \n \"errorNum\" : 1202 \n}\n</code></pre><br><br><br> Revision conflict: <br><br><br><br><pre><code class=\"json\">shell> curl -X DELETE --header 'If-Match: \"1230708230\"' --dump - http://localhost:8529/_api/document/products/1230380550\n\nHTTP/1.1 412 Precondition Failed\ncontent-type: application/json; charset=utf-8\netag: \"1230380550\"\n\n{ \n \"error\" : true, \n \"code\" : 412, \n \"errorNum\" : 1200, \n \"errorMessage\" : \"precondition failed\", \n \"_id\" : \"products/1230380550\", \n \"_rev\" : \"1230380550\", \n \"_key\" : \"1230380550\" \n}\n</code></pre><br>@endDocuBlock",
"nickname": "DeletesDocument"
}
],
"path": "/_api/document/{document-handle}"

View File

@ -16,7 +16,7 @@
"code": "202"
},
{
"reason": "is returned if the body does not contain a valid JSON representation of an edge, or if the collection specified is not an edge collection. The response body contains an error document in this case. <br><br>",
"reason": "is returned if the body does not contain a valid JSON representation of an edge, or if the collection specified is not an edge collection. The response body contains an error document in this case. <br><br>",
"code": "400"
},
{
@ -44,7 +44,7 @@
"paramType": "query",
"required": "false",
"name": "createCollection",
"description": "If this parameter has a value of <em>true</em> or <em>yes</em>, 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. <br><br> Note: this flag is not supported in a cluster. Using it will result in an error. <br><br>"
"description": "If this parameter has a value of <em>true</em> or <em>yes</em>, 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. <br><br> <em>*Note*</em>: This flag is not supported in a cluster. Using it will result in an error. <br><br>"
},
{
"dataType": "Boolean",
@ -68,11 +68,11 @@
"description": "The document handle of the end point must be passed in <em>to</em> handle. <br><br>"
}
],
"notes": "Creates a new edge document in the collection named <em>collection</em>. A JSON representation of the document must be passed as the body of the POST request. <br><br> The <em>from</em> and <em>to</em> handles are immutable once the edge has been created. <br><br> In all other respects the method works like <em>POST /document</em>, see the manual for details. <br><br>",
"summary": "creates an edge",
"notes": "Creates a new edge document in the collection named <em>collection</em>. A JSON representation of the document must be passed as the body of the POST request. <br><br> The <em>from</em> and <em>to</em> handles are immutable once the edge has been created. <br><br> In all other respects the method works like <em>POST /document</em>. <br><br>",
"summary": "Create edge",
"httpMethod": "POST",
"examples": "<br><br> Create an edge and read it back: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/edge/?collection=edges&from=vertices/1&to=vertices/2\n{\"name\":\"Emil\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"309739943\"\nlocation: /_db/_system/_api/document/edges/309739943\n\n{ \n \"error\" : false, \n \"_id\" : \"edges/309739943\", \n \"_rev\" : \"309739943\", \n \"_key\" : \"309739943\" \n}\n\nunix> curl --dump - http://localhost:8529/_api/edge/edges/309739943\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"309739943\"\n\n{ \n \"name\" : \"Emil\", \n \"_id\" : \"edges/309739943\", \n \"_rev\" : \"309739943\", \n \"_key\" : \"309739943\", \n \"_from\" : \"vertices/1\", \n \"_to\" : \"vertices/2\" \n}\n\n</code></pre><br>",
"nickname": "createsAnEdge"
"examples": "<br><br> Create an edge and read it back: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/edge/?collection=edges&from=vertices/1&to=vertices/2\n{ \n \"name\" : \"Emil\" \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"1233067526\"\nlocation: /_db/_system/_api/document/edges/1233067526\n\n{ \n \"error\" : false, \n \"_id\" : \"edges/1233067526\", \n \"_rev\" : \"1233067526\", \n \"_key\" : \"1233067526\" \n}\nshell> curl --data-binary @- --dump - http://localhost:8529/_api/edge/edges/1233067526\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"1233067526\"\n\n{ \n \"name\" : \"Emil\", \n \"_id\" : \"edges/1233067526\", \n \"_rev\" : \"1233067526\", \n \"_key\" : \"1233067526\", \n \"_from\" : \"vertices/1\", \n \"_to\" : \"vertices/2\" \n}\n</code></pre><br>@endDocuBlock",
"nickname": "CreateEdge"
}
],
"path": "/_api/edge"
@ -86,7 +86,7 @@
"code": "200"
},
{
"reason": "is returned if the \"If-None-Match\" header is given and the edge has the same version <br><br>",
"reason": "is returned if the \"If-None-Match\" header is given and the edge has the same version <br><br>",
"code": "304"
},
{
@ -94,7 +94,7 @@
"code": "404"
},
{
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version. The response will also contain the found document's current revision in the <em>_rev</em> attribute. Additionally, the attributes <em>_id</em> and <em>_key</em> will be returned.",
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version. The response will also contain the found document's current revision in the <em>_rev</em> attribute. Additionally, the attributes <em>_id</em> and <em>_key</em> will be returned. @endDocuBlock",
"code": "412"
}
],
@ -119,11 +119,11 @@
"description": "If the \"If-Match\" header is given, then it must contain exactly one etag. The edge is returned if it has the same revision ad the given etag. Otherwise a <em>HTTP 412</em> is returned. As an alternative you can supply the etag in an attribute <em>rev</em> in the URL. <br><br>"
}
],
"notes": "Returns the edge identified by <em>document-handle</em>. The returned edge contains a few special attributes: <br><br> <ul class=\"swagger-list\"><li><em>_id</em> contains the document handle <li><em>_rev</em> contains the revision <li><em>_from</em> and <em>to</em> contain the document handles of the connected vertex documents",
"summary": "reads an edge",
"notes": "Returns the edge identified by <em>document-handle</em>. The returned edge contains a few special attributes: <br><br> <ul class=\"swagger-list\"><li><em>_id</em> contains the document handle <li><em>_rev</em> contains the revision <li><em>_from</em> and <em>to</em> contain the document handles of the connected vertex documents",
"summary": " Read edge",
"httpMethod": "GET",
"examples": "",
"nickname": "readsAnEdge"
"nickname": "ReadEdge"
}
],
"path": "/_api/edge/{document-handle}"
@ -137,7 +137,7 @@
"code": "200"
},
{
"reason": "The collection does not exist.",
"reason": "The collection does not exist. @endDocuBlock",
"code": "404"
}
],
@ -151,10 +151,10 @@
}
],
"notes": "Returns a list of all URI for all edges from the collection identified by <em>collection</em>. <br><br>",
"summary": "reads all edges from collection",
"summary": " Read all edges from collection",
"httpMethod": "GET",
"examples": "",
"nickname": "readsAllEdgesFromCollection"
"nickname": "ReadAllEdgesFromCollection"
}
],
"path": "/_api/edge"
@ -176,7 +176,7 @@
"code": "404"
},
{
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version. The response will also contain the found document's current revision in the <em>etag</em> header.",
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version. The response will also contain the found document's current revision in the <em>etag</em> header. @endDocuBlock",
"code": "412"
}
],
@ -203,10 +203,10 @@
}
],
"notes": "Like <em>GET</em>, but only returns the header fields and not the body. You can use this call to get the current revision of an edge document or check if it was deleted. <br><br>",
"summary": "reads an edge header",
"summary": " Read edge header",
"httpMethod": "HEAD",
"examples": "",
"nickname": "readsAnEdgeHeader"
"nickname": "ReadEdgeHeader"
}
],
"path": "/_api/edge/{document-handle}"
@ -224,7 +224,7 @@
"code": "202"
},
{
"reason": "is returned if the body does not contain a valid JSON representation of an edge document or if applied to a non-edge collection. The response body contains an error document in this case. <br><br>",
"reason": "is returned if the body does not contain a valid JSON representation of an edge document or if applied to a non-edge collection. The response body contains an error document in this case. <br><br>",
"code": "400"
},
{
@ -232,7 +232,7 @@
"code": "404"
},
{
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version. The response will also contain the found document's current revision in the <em>_rev</em> attribute. Additionally, the attributes <em>_id</em> and <em>_key</em> will be returned.",
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version. The response will also contain the found document's current revision in the <em>_rev</em> attribute. Additionally, the attributes <em>_id</em> and <em>_key</em> will be returned. @endDocuBlock",
"code": "412"
}
],
@ -279,7 +279,7 @@
"description": "You can conditionally replace an edge document based on a target revision id by using the <em>if-match</em> HTTP header. <br><br>"
}
],
"notes": "Completely updates (i.e. replaces) the edge document identified by <em>document-handle</em>. If the edge document exists and can be updated, then a <em>HTTP 201</em> is returned and the \"ETag\" header field contains the new revision of the edge document. <br><br> If the new edge document passed in the body of the request contains the <em>document-handle</em> in the attribute <em>_id</em> and the revision in <em>_rev</em>, these attributes will be ignored. Only the URI and the \"ETag\" header are relevant in order to avoid confusion when using proxies. Note that the attributes <em>_from</em> and <em>_to</em> of an edge are immutable and cannot be updated either. <br><br> Optionally, the URL parameter <em>waitForSync</em> can be used to force synchronisation of the edge document replacement operation to disk even in case that the <em>waitForSync</em> flag had been disabled for the entire collection. Thus, the <em>waitForSync</em> URL parameter can be used to force synchronisation of just specific operations. To use this, set the <em>waitForSync</em> parameter to <em>true</em>. If the <em>waitForSync</em> parameter is not specified or set to <em>false</em>, then the collection's default <em>waitForSync</em> behavior is applied. The <em>waitForSync</em> URL parameter cannot be used to disable synchronisation for collections that have a default <em>waitForSync</em> value of <em>true</em>. <br><br> The body of the response contains a JSON object with the information about the handle and the revision. The attribute <em>_id</em> contains the known <em>document-handle</em> of the updated edge document, the attribute <em>_rev</em> contains the new revision of the edge document. <br><br> If the edge document does not exist, then a <em>HTTP 404</em> is returned and the body of the response contains an error document. <br><br> There are two ways for specifying the targeted revision id for conditional replacements (i.e. replacements that will only be executed if the revision id found in the database matches the revision id specified in the request): <ul class=\"swagger-list\"><li>specifying the target revision in the <em>rev</em> URL query parameter <li>specifying the target revision in the <em>if-match</em> HTTP header </ul> Specifying a target revision is optional, however, if done, only one of the described mechanisms must be used (either the <em>rev</em> URL parameter or the <em>if-match</em> HTTP header). Regardless which mechanism is used, the parameter needs to contain the target revision id as returned in the <em>_rev</em> attribute of an edge document or by an HTTP <em>etag</em> header. <br><br> For example, to conditionally replace an edge document based on a specific revision id, you can use the following request: <br><br> <ul class=\"swagger-list\"><li>PUT /_api/document/<em>document-handle</em>?rev=<em>etag</em> </ul> If a target revision id is provided in the request (e.g. via the <em>etag</em> value in the <em>rev</em> URL query parameter above), ArangoDB will check that the revision id of the edge 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 <em>HTTP 412</em> conflict is returned and no replacement is performed. <br><br> The conditional update behavior can be overriden with the <em>policy</em> URL query parameter: <br><br> <ul class=\"swagger-list\"><li>PUT /_api/document/<em>document-handle</em>?policy=<em>policy</em> </ul> If <em>policy</em> is set to <em>error</em>, 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. <br><br> If <em>policy</em> is set to <em>last</em>, 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 <em>last</em> `policy` to force replacements. <br><br>",
"notes": "Completely updates (i.e. replaces) the edge document identified by <em>document-handle</em>. If the edge document exists and can be updated, then a <em>HTTP 201</em> is returned and the \"ETag\" header field contains the new revision of the edge document. <br><br> If the new edge document passed in the body of the request contains the <em>document-handle</em> in the attribute <em>_id</em> and the revision in <em>_rev</em>, these attributes will be ignored. Only the URI and the \"ETag\" header are relevant in order to avoid confusion when using proxies. <em>*Note*</em>: The attributes <em>_from</em> and <em>_to</em> of an edge are immutable and cannot be updated either. <br><br> Optionally, the URL parameter <em>waitForSync</em> can be used to force synchronisation of the edge document replacement operation to disk even in case that the <em>waitForSync</em> flag had been disabled for the entire collection. Thus, the <em>waitForSync</em> URL parameter can be used to force synchronisation of just specific operations. To use this, set the <em>waitForSync</em> parameter to <em>true</em>. If the <em>waitForSync</em> parameter is not specified or set to <em>false</em>, then the collection's default <em>waitForSync</em> behavior is applied. The <em>waitForSync</em> URL parameter cannot be used to disable synchronisation for collections that have a default <em>waitForSync</em> value of <em>true</em>. <br><br> The body of the response contains a JSON object with the information about the handle and the revision. The attribute <em>_id</em> contains the known <em>document-handle</em> of the updated edge document, the attribute <em>_rev</em> contains the new revision of the edge document. <br><br> If the edge document does not exist, then a <em>HTTP 404</em> is returned and the body of the response contains an error document. <br><br> There are two ways for specifying the targeted revision id for conditional replacements (i.e. replacements that will only be executed if the revision id found in the database matches the revision id specified in the request): <ul class=\"swagger-list\"><li>specifying the target revision in the <em>rev</em> URL query parameter <li>specifying the target revision in the <em>if-match</em> HTTP header </ul> Specifying a target revision is optional, however, if done, only one of the described mechanisms must be used (either the <em>rev</em> URL parameter or the <em>if-match</em> HTTP header). Regardless which mechanism is used, the parameter needs to contain the target revision id as returned in the <em>_rev</em> attribute of an edge document or by an HTTP <em>etag</em> header. <br><br> For example, to conditionally replace an edge document based on a specific revision id, you can use the following request: <br><br> <ul class=\"swagger-list\"><li>PUT /_api/document/<em>document-handle</em>?rev=<em>etag</em> </ul> If a target revision id is provided in the request (e.g. via the <em>etag</em> value in the <em>rev</em> URL query parameter above), ArangoDB will check that the revision id of the edge 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 <em>HTTP 412</em> conflict is returned and no replacement is performed. <br><br> The conditional update behavior can be overriden with the <em>policy</em> URL query parameter: <br><br> <ul class=\"swagger-list\"><li>PUT /_api/document/<em>document-handle</em>?policy=<em>policy</em> </ul> If <em>policy</em> is set to <em>error</em>, 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. <br><br> If <em>policy</em> is set to <em>last</em>, 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 <em>last</em> *policy* to force replacements. <br><br>",
"summary": "replaces an edge",
"httpMethod": "PUT",
"examples": "",
@ -301,7 +301,7 @@
"code": "202"
},
{
"reason": "is returned if the body does not contain a valid JSON representation or when applied on an non-edge collection. The response body contains an error document in this case. <br><br>",
"reason": "is returned if the body does not contain a valid JSON representation or when applied on an non-edge collection. The response body contains an error document in this case. <br><br>",
"code": "400"
},
{
@ -309,7 +309,7 @@
"code": "404"
},
{
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version. The response will also contain the found document's current revision in the <em>_rev</em> attribute. Additionally, the attributes <em>_id</em> and <em>_key</em> will be returned.",
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version. The response will also contain the found document's current revision in the <em>_rev</em> attribute. Additionally, the attributes <em>_id</em> and <em>_key</em> will be returned. @endDocuBlock",
"code": "412"
}
],
@ -333,7 +333,7 @@
"paramType": "query",
"required": "false",
"name": "keepNull",
"description": "If the intention is to delete existing attributes with the patch command, the URL query parameter <em>keepNull</em> can be used with a value of <em>false</em>. This will modify the behavior of the patch command to remove any attributes from the existing edge document that are contained in the patch document with an attribute value of <em>null</em>. <br><br>"
"description": "If the intention is to delete existing attributes with the patch command, the URL query parameter <em>keepNull</em> can be used with a value of <em>false</em>. This will modify the behavior of the patch command to remove any attributes from the existing edge document that are contained in the patch document with an attribute value of <em>null</em>. <br><br>"
},
{
"dataType": "Boolean",
@ -363,11 +363,11 @@
"description": "You can conditionally patch an edge document based on a target revision id by using the <em>if-match</em> HTTP header. <br><br>"
}
],
"notes": "Partially updates the edge document identified by <em>document-handle</em>. 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 edge document if they do not yet exist, and overwritten in the existing edge document if they do exist there. <br><br> Setting an attribute value to <em>null</em> in the patch document will cause a value of <em>null</em> be saved for the attribute by default. <br><br> Note that internal attributes such as <em>_key</em>, <em>_from</em> and <em>_to</em> are immutable once set and cannot be updated. <br><br> Optionally, the URL parameter <em>waitForSync</em> can be used to force synchronisation of the edge document update operation to disk even in case that the <em>waitForSync</em> flag had been disabled for the entire collection. Thus, the <em>waitForSync</em> URL parameter can be used to force synchronisation of just specific operations. To use this, set the <em>waitForSync</em> parameter to <em>true</em>. If the <em>waitForSync</em> parameter is not specified or set to <em>false</em>, then the collection's default <em>waitForSync</em> behavior is applied. The <em>waitForSync</em> URL parameter cannot be used to disable synchronisation for collections that have a default <em>waitForSync</em> value of <em>true</em>. <br><br> The body of the response contains a JSON object with the information about the handle and the revision. The attribute <em>_id</em> contains the known <em>document-handle</em> of the updated edge document, the attribute <em>_rev</em> contains the new edge document revision. <br><br> If the edge document does not exist, then a <em>HTTP 404</em> is returned and the body of the response contains an error document. <br><br> You can conditionally update an edge document based on a target revision id by using either the <em>rev</em> URL parameter or the <em>if-match</em> HTTP header. To control the update behavior in case there is a revision mismatch, you can use the <em>policy</em> parameter. This is the same as when replacing edge documents (see replacing documents for details). <br><br>",
"summary": "patches an edge",
"notes": "Partially updates the edge document identified by <em>document-handle</em>. 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 edge document if they do not yet exist, and overwritten in the existing edge document if they do exist there. <br><br> Setting an attribute value to <em>null</em> in the patch document will cause a value of <em>null</em> be saved for the attribute by default. <br><br> <em>*Note*</em>: Internal attributes such as <em>_key</em>, <em>_from</em> and <em>_to</em> are immutable once set and cannot be updated. <br><br> Optionally, the URL parameter <em>waitForSync</em> can be used to force synchronisation of the edge document update operation to disk even in case that the <em>waitForSync</em> flag had been disabled for the entire collection. Thus, the <em>waitForSync</em> URL parameter can be used to force synchronisation of just specific operations. To use this, set the <em>waitForSync</em> parameter to <em>true</em>. If the <em>waitForSync</em> parameter is not specified or set to <em>false</em>, then the collection's default <em>waitForSync</em> behavior is applied. The <em>waitForSync</em> URL parameter cannot be used to disable synchronisation for collections that have a default <em>waitForSync</em> value of <em>true</em>. <br><br> The body of the response contains a JSON object with the information about the handle and the revision. The attribute <em>_id</em> contains the known <em>document-handle</em> of the updated edge document, the attribute <em>_rev</em> contains the new edge document revision. <br><br> If the edge document does not exist, then a <em>HTTP 404</em> is returned and the body of the response contains an error document. <br><br> You can conditionally update an edge document based on a target revision id by using either the <em>rev</em> URL parameter or the <em>if-match</em> HTTP header. To control the update behavior in case there is a revision mismatch, you can use the <em>policy</em> parameter. This is the same as when replacing edge documents (see replacing documents for details). <br><br>",
"summary": " Patches edge",
"httpMethod": "PATCH",
"examples": "",
"nickname": "patchesAnEdge"
"nickname": "PatchesEdge"
}
],
"path": "/_api/edge/{document-handle}"
@ -389,7 +389,7 @@
"code": "404"
},
{
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version. The response will also contain the found document's current revision in the <em>_rev</em> attribute. Additionally, the attributes <em>_id</em> and <em>_key</em> will be returned.",
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version. The response will also contain the found document's current revision in the <em>_rev</em> attribute. Additionally, the attributes <em>_id</em> and <em>_key</em> will be returned. @endDocuBlock",
"code": "412"
}
],
@ -399,7 +399,7 @@
"paramType": "path",
"required": "true",
"name": "document-handle",
"description": "Deletes the edge document identified by <em>document-handle</em>. <br><br>"
"description": "Deletes the edge document identified by <em>document-handle</em>. <br><br>"
},
{
"dataType": "String",
@ -430,10 +430,10 @@
}
],
"notes": "The body of the response contains a JSON object with the information about the handle and the revision. The attribute <em>_id</em> contains the known <em>document-handle</em> of the deleted edge document, the attribute <em>_rev</em> contains the edge document revision. <br><br> If the <em>waitForSync</em> parameter is not specified or set to <em>false</em>, then the collection's default <em>waitForSync</em> behavior is applied. The <em>waitForSync</em> URL parameter cannot be used to disable synchronisation for collections that have a default <em>waitForSync</em> value of <em>true</em>. <br><br>",
"summary": "deletes an edge",
"summary": " Deletes edge",
"httpMethod": "DELETE",
"examples": "",
"nickname": "deletesAnEdge"
"nickname": "DeletesEdge"
}
],
"path": "/_api/edge/{document-handle}"

View File

@ -31,10 +31,10 @@
}
],
"notes": "Returns the list of edges starting or ending in the vertex identified by <em>vertex-handle</em>. <br><br>",
"summary": "reads in- or outbound edges",
"summary": " Read in- or outbound edges",
"httpMethod": "GET",
"examples": "<br><br> Any direction <br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"edges\" : [ \n { \n \"_id\" : \"edges/6\", \n \"_rev\" : \"113525159\", \n \"_key\" : \"6\", \n \"_from\" : \"vertices/2\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v2 -> v1\" \n }, \n { \n \"_id\" : \"edges/7\", \n \"_rev\" : \"114049447\", \n \"_key\" : \"7\", \n \"_from\" : \"vertices/4\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v4 -> v1\" \n }, \n { \n \"_id\" : \"edges/5\", \n \"_rev\" : \"113000871\", \n \"_key\" : \"5\", \n \"_from\" : \"vertices/1\", \n \"_to\" : \"vertices/3\", \n \"$label\" : \"v1 -> v3\" \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br> In edges <br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1&direction=in\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"edges\" : [ \n { \n \"_id\" : \"edges/6\", \n \"_rev\" : \"118178215\", \n \"_key\" : \"6\", \n \"_from\" : \"vertices/2\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v2 -> v1\" \n }, \n { \n \"_id\" : \"edges/7\", \n \"_rev\" : \"118702503\", \n \"_key\" : \"7\", \n \"_from\" : \"vertices/4\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v4 -> v1\" \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br> Out edges <br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1&direction=out\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"edges\" : [ \n { \n \"_id\" : \"edges/5\", \n \"_rev\" : \"122306983\", \n \"_key\" : \"5\", \n \"_from\" : \"vertices/1\", \n \"_to\" : \"vertices/3\", \n \"$label\" : \"v1 -> v3\" \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "readsIn-OrOutboundEdges"
"examples": "<br><br> Any direction <br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"edges\" : [ \n { \n \"_id\" : \"edges/6\", \n \"_rev\" : \"906436102\", \n \"_key\" : \"6\", \n \"_from\" : \"vertices/2\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v2 -> v1\" \n }, \n { \n \"_id\" : \"edges/7\", \n \"_rev\" : \"906960390\", \n \"_key\" : \"7\", \n \"_from\" : \"vertices/4\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v4 -> v1\" \n }, \n { \n \"_id\" : \"edges/5\", \n \"_rev\" : \"905911814\", \n \"_key\" : \"5\", \n \"_from\" : \"vertices/1\", \n \"_to\" : \"vertices/3\", \n \"$label\" : \"v1 -> v3\" \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br> In edges <br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1&direction=in\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"edges\" : [ \n { \n \"_id\" : \"edges/6\", \n \"_rev\" : \"911220230\", \n \"_key\" : \"6\", \n \"_from\" : \"vertices/2\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v2 -> v1\" \n }, \n { \n \"_id\" : \"edges/7\", \n \"_rev\" : \"911744518\", \n \"_key\" : \"7\", \n \"_from\" : \"vertices/4\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v4 -> v1\" \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br> Out edges <br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1&direction=out\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"edges\" : [ \n { \n \"_id\" : \"edges/5\", \n \"_rev\" : \"915480070\", \n \"_key\" : \"5\", \n \"_from\" : \"vertices/1\", \n \"_to\" : \"vertices/3\", \n \"$label\" : \"v1 -> v3\" \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "ReadIn-OrOutboundEdges"
}
],
"path": "/_api/edges/{collection-id}"

View File

@ -21,11 +21,11 @@
}
],
"parameters": [],
"notes": "Returns a list of all configured endpoints the server is listening on. For each endpoint, the list of allowed databases is returned too if set. <br><br> The result is a JSON hash which has the endpoints as keys, and the list of mapped database names as values for each endpoint. <br><br> If a list of mapped databases is empty, it means that all databases can be accessed via the endpoint. If a list of mapped databases contains more than one database name, this means that any of the databases might be accessed via the endpoint, and the first database in the list will be treated as the default database for the endpoint. The default database will be used when an incoming request does not specify a database name in the request explicitly. <br><br> Note: retrieving the list of all endpoints is allowed in the system database only. Calling this action in any other database will make the server return an error. <br><br>",
"summary": "returns a list of all endpoints",
"notes": "Returns a list of all configured endpoints the server is listening on. For each endpoint, the list of allowed databases is returned too if set. <br><br> The result is a JSON hash which has the endpoints as keys, and the list of mapped database names as values for each endpoint. <br><br> If a list of mapped databases is empty, it means that all databases can be accessed via the endpoint. If a list of mapped databases contains more than one database name, this means that any of the databases might be accessed via the endpoint, and the first database in the list will be treated as the default database for the endpoint. The default database will be used when an incoming request does not specify a database name in the request explicitly. <br><br> <em>*Note*</em>: retrieving the list of all endpoints is allowed in the system database only. Calling this action in any other database will make the server return an error. <br><br>",
"summary": " Return list of all endpoints",
"httpMethod": "GET",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/endpoint\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n[ \n { \n \"endpoint\" : \"tcp://127.0.0.1:35134\", \n \"databases\" : [ ] \n }, \n { \n \"endpoint\" : \"tcp://127.0.0.1:8532\", \n \"databases\" : [ \n \"mydb1\", \n \"mydb2\" \n ] \n } \n]\n\n</code></pre><br>",
"nickname": "returnsAListOfAllEndpoints"
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/endpoint\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n[ \n { \n \"endpoint\" : \"tcp://127.0.0.1:32357\", \n \"databases\" : [ ] \n }, \n { \n \"endpoint\" : \"tcp://127.0.0.1:8532\", \n \"databases\" : [ \n \"mydb1\", \n \"mydb2\" \n ] \n } \n]\n</code></pre><br>@endDocuBlock",
"nickname": "ReturnListOfAllEndpoints"
}
],
"path": "/_api/endpoint"
@ -56,11 +56,11 @@
"description": "A JSON object describing the endpoint. <br><br>"
}
],
"notes": "The request body must be JSON hash with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>endpoint</em>: the endpoint specification, e.g. <em>tcp://127.0.0.1:8530</em> <li><em>databases</em>: a list of database names the endpoint is responsible for. </ul> If <em>databases</em> is an empty list, all databases present in the server will become accessible via the endpoint, with the <em>_system</em> database being the default database. <br><br> If <em>databases</em> is non-empty, only the specified databases will become available via the endpoint. The first database name in the <em>databases</em> list will also become the default database for the endpoint. The default database will always be used if a request coming in on the endpoint does not specify the database name explicitly. <br><br> Note: adding or reconfiguring endpoints is allowed in the system database only. Calling this action in any other database will make the server return an error. <br><br> Adding SSL endpoints at runtime is only supported if the server was started with SSL properly configured (e.g. <em>--server.keyfile</em> must have been set). <br><br>",
"summary": "adds a new endpoint or reconfigures an existing endpoint",
"notes": "The request body must be JSON hash with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>endpoint</em>: the endpoint specification, e.g. <em>tcp://127.0.0.1:8530</em> <li><em>databases</em>: a list of database names the endpoint is responsible for. </ul> If <em>databases</em> is an empty list, all databases present in the server will become accessible via the endpoint, with the <em>_system</em> database being the default database. <br><br> If <em>databases</em> is non-empty, only the specified databases will become available via the endpoint. The first database name in the <em>databases</em> list will also become the default database for the endpoint. The default database will always be used if a request coming in on the endpoint does not specify the database name explicitly. <br><br> <em>*Note*</em>: adding or reconfiguring endpoints is allowed in the system database only. Calling this action in any other database will make the server return an error. <br><br> Adding SSL endpoints at runtime is only supported if the server was started with SSL properly configured (e.g. <em>--server.keyfile</em> must have been set). <br><br>",
"summary": " Add new endpoint or reconfigures an existing endpoint",
"httpMethod": "POST",
"examples": "Adding an endpoint <em>tcp://127.0.0.1:8532</em> with two mapped databases (<em>mydb1</em> and <em>mydb2</em>). <em>mydb1</em> will become the default database for the endpoint. <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/endpoint\n{\"endpoint\":\"tcp://127.0.0.1:8532\",\"databases\":[\"mydb1\",\"mydb2\"]}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br> Adding an endpoint <em>tcp://127.0.0.1:8533</em> with no database names specified. This will allow access to all databases on this endpoint. The <em>_system</em> database will become the default database for requests that come in on this endpoint and do not specify the database name explicitly. <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/endpoint\n{\"endpoint\":\"tcp://127.0.0.1:8533\",\"databases\":[]}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br> Adding an endpoint <em>tcp://127.0.0.1:8533</em> without any databases first, and then updating the databases for the endpoint to <em>testdb1</em>, <em>testdb2</em>, and <em>testdb3</em>. <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/endpoint\n{\"endpoint\":\"tcp://127.0.0.1:8533\",\"databases\":[]}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n\nunix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/endpoint\n{\"endpoint\":\"tcp://127.0.0.1:8533\",\"databases\":[],\"database\":[\"testdb1\",\"testdb2\",\"testdb3\"]}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "addsANewEndpointOrReconfiguresAnExistingEndpoint"
"examples": "Adding an endpoint <em>tcp://127.0.0.1:8532</em> with two mapped databases (<em>mydb1</em> and <em>mydb2</em>). <em>mydb1</em> will become the default database for the endpoint. <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/endpoint\n{\"endpoint\":\"tcp://127.0.0.1:8532\",\"databases\":[\"mydb1\",\"mydb2\"]}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br> Adding an endpoint <em>tcp://127.0.0.1:8533</em> with no database names specified. This will allow access to all databases on this endpoint. The <em>_system</em> database will become the default database for requests that come in on this endpoint and do not specify the database name explicitly. <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/endpoint\n{\"endpoint\":\"tcp://127.0.0.1:8533\",\"databases\":[]}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br> Adding an endpoint <em>tcp://127.0.0.1:8533</em> without any databases first, and then updating the databases for the endpoint to <em>testdb1</em>, <em>testdb2</em>, and <em>testdb3</em>. <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/endpoint\n{\"endpoint\":\"tcp://127.0.0.1:8533\",\"databases\":[]}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\nshell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/endpoint\n{\"endpoint\":\"tcp://127.0.0.1:8533\",\"databases\":[],\"database\":[\"testdb1\",\"testdb2\",\"testdb3\"]}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "AddNewEndpointOrReconfiguresAnExistingEndpoint"
}
],
"path": "/_api/endpoint"
@ -95,11 +95,11 @@
"description": "The endpoint to delete, e.g. <em>tcp://127.0.0.1:8529</em>. <br><br>"
}
],
"notes": "This operation deletes an existing endpoint from the list of all endpoints, and makes the server stop listening on the endpoint. <br><br> Note: deleting and disconnecting an endpoint is allowed in the system database only. Calling this action in any other database will make the server return an error. <br><br> Futhermore, the last remaining endpoint cannot be deleted as this would make the server kaputt. <br><br>",
"summary": "deletes and disconnects an existing endpoint",
"notes": "This operation deletes an existing endpoint from the list of all endpoints, and makes the server stop listening on the endpoint. <br><br> <em>*Note*</em>: deleting and disconnecting an endpoint is allowed in the system database only. Calling this action in any other database will make the server return an error. <br><br> Futhermore, the last remaining endpoint cannot be deleted as this would make the server kaputt. <br><br>",
"summary": " Delete and disconnects an existing endpoint",
"httpMethod": "DELETE",
"examples": "<br><br> Deleting an existing endpoint <br><br><br><br><pre><code class=\"json\">unix> curl -X DELETE --dump - http://localhost:8529/_api/endpoint/tcp%3A%2F%2F127.0.0.1%3A8532\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br> Deleting a non-existing endpoint <br><br><br><br><pre><code class=\"json\">unix> curl -X DELETE --dump - http://localhost:8529/_api/endpoint/tcp%3A%2F%2F127.0.0.1%3A8532\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 1231, \n \"errorMessage\" : \"endpoint not found\" \n}\n\n</code></pre><br>",
"nickname": "deletesAndDisconnectsAnExistingEndpoint"
"examples": "<br><br> Deleting an existing endpoint <br><br><br><br><pre><code class=\"json\">shell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/endpoint/tcp%3A%2F%2F127.0.0.1%3A8532\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br> Deleting a non-existing endpoint <br><br><br><br><pre><code class=\"json\">shell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/endpoint/tcp%3A%2F%2F127.0.0.1%3A8532\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 1231, \n \"errorMessage\" : \"endpoint not found\" \n}\n</code></pre><br>@endDocuBlock",
"nickname": "DeleteAndDisconnectsAnExistingEndpoint"
}
],
"path": "/_api/endpoint/{endpoint}"

View File

@ -30,10 +30,10 @@
}
],
"notes": "<br><br> To explain how an AQL query would be executed on the server, the query string can be sent to the server via an HTTP POST request. The server will then validate the query and create an execution plan for it, but will not execute it. <br><br> The execution plan that is returned by the server can be used to estimate the probable performance of an AQL query. Though the actual performance will depend on many different factors, the execution plan normally can give some good hint on the amount of work the server needs to do in order to actually run the query. <br><br> The top-level statements will appear in the result in the same order in which they have been used in the original query. Each result element has at most the following attributes: <ul class=\"swagger-list\"><li><em>id</em>: the row number of the top-level statement, starting at 1 <li><em>type</em>: the type of the top-level statement (e.g. <em>for</em>, <em>return</em> ...) <li><em>loopLevel</em>: the nesting level of the top-level statement, starting at 1 </ul> Depending on the type of top-level statement, there might be other attributes providing additional information, for example, if and which indexed will be used. Many top-level statements will provide an <em>expression</em> attribute that contains data about the expression they operate on. This is true for <em>FOR</em>, <em>FILTER</em>, <em>SORT</em>, <em>COLLECT</em>, and <em>RETURN</em> statements. The <em>expression</em> attribute has the following sub-attributes: <ul class=\"swagger-list\"><li><em>type</em>: the type of the expression. Some possible values are: - <em>collection</em>: an iteration over documents from a collection. The <em>value</em> attribute will then contain the collection name. The <em>extra</em> attribute will contain information about if and which index is used when accessing the documents from the collection. If no index is used, the <em>accessType</em> sub-attribute of the <em>extra</em> attribute will have the value <em>all</em>, otherwise it will be <em>index</em>. - <em>list</em>: a list of dynamic values. The <em>value</em> attribute will contain the list elements. - <em>const list</em>: a list of constant values. The <em>value</em> attribute will contain the list elements. - <em>reference</em>: a reference to another variable. The <em>value</em> attribute will contain the name of the variable that is referenced. </ul> Please note that the structure of the explain result data might change in future versions of ArangoDB without further notice and without maintaining backwards compatibility. <br><br>",
"summary": "explains a query",
"summary": " Explain query",
"httpMethod": "POST",
"examples": "<br><br> Valid query: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/explain\n{ \"query\" : \"FOR p IN products FILTER p.id == @id LIMIT 2 RETURN p.name\", \"bindVars\": { \"id\" : 3 } }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"plan\" : [ \n { \n \"id\" : 1, \n \"loopLevel\" : 1, \n \"type\" : \"for\", \n \"resultVariable\" : \"p\", \n \"limit\" : true, \n \"expression\" : { \n \"type\" : \"collection\", \n \"value\" : \"products\", \n \"extra\" : { \n \"accessType\" : \"all\" \n } \n } \n }, \n { \n \"id\" : 2, \n \"loopLevel\" : 1, \n \"type\" : \"filter\", \n \"expression\" : { \n \"type\" : \"expression\", \n \"value\" : \"p.id == 3\" \n } \n }, \n { \n \"id\" : 3, \n \"loopLevel\" : 1, \n \"type\" : \"return\", \n \"expression\" : { \n \"type\" : \"expression\", \n \"value\" : \"p.name\" \n } \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br> Invalid query: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/explain\n{ \"query\" : \"FOR p IN products FILTER p.id == @id LIMIT 2 RETURN p.n\" }\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1551, \n \"errorMessage\" : \"no value specified for declared bind parameter 'id'\" \n}\n\n</code></pre><br><br><br> The data returned in the <em>plan</em> attribute of the result contains one element per AQL top-level statement (i.e. <em>FOR</em>, <em>RETURN</em>, <em>FILTER</em> etc.). If the query optimiser removed some unnecessary statements, the result might also contain less elements than there were top-level statements in the AQL query. The following example shows a query with a non-sensible filter condition that the optimiser has removed so that there are less top-level statements: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/explain\n{ \"query\" : \"FOR i IN [ 1, 2, 3 ] FILTER 1 == 2 RETURN i\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"plan\" : [ \n { \n \"id\" : 1, \n \"loopLevel\" : 0, \n \"type\" : \"return (empty)\", \n \"expression\" : { \n \"type\" : \"const list\", \n \"value\" : \"[ ]\" \n } \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "explainsAQuery"
"examples": "<br><br> Valid query: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/explain\n{ \"query\" : \"FOR p IN products FILTER p.id == @id LIMIT 2 RETURN p.name\", \"bindVars\": { \"id\" : 3 } }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"plan\" : [ \n { \n \"id\" : 1, \n \"loopLevel\" : 1, \n \"type\" : \"for\", \n \"resultVariable\" : \"p\", \n \"limit\" : true, \n \"expression\" : { \n \"type\" : \"collection\", \n \"value\" : \"products\", \n \"extra\" : { \n \"accessType\" : \"all\" \n } \n } \n }, \n { \n \"id\" : 2, \n \"loopLevel\" : 1, \n \"type\" : \"filter\", \n \"expression\" : { \n \"type\" : \"expression\", \n \"value\" : \"p.id == 3\" \n } \n }, \n { \n \"id\" : 3, \n \"loopLevel\" : 1, \n \"type\" : \"return\", \n \"expression\" : { \n \"type\" : \"expression\", \n \"value\" : \"p.name\" \n } \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br> Invalid query: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/explain\n{ \"query\" : \"FOR p IN products FILTER p.id == @id LIMIT 2 RETURN p.n\" }\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1551, \n \"errorMessage\" : \"no value specified for declared bind parameter 'id'\" \n}\n</code></pre><br><br><br> The data returned in the <em>plan</em> attribute of the result contains one element per AQL top-level statement (i.e. <em>FOR</em>, <em>RETURN</em>, <em>FILTER</em> etc.). If the query optimiser removed some unnecessary statements, the result might also contain less elements than there were top-level statements in the AQL query. The following example shows a query with a non-sensible filter condition that the optimiser has removed so that there are less top-level statements: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/explain\n{ \"query\" : \"FOR i IN [ 1, 2, 3 ] FILTER 1 == 2 RETURN i\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"plan\" : [ \n { \n \"id\" : 1, \n \"loopLevel\" : 0, \n \"type\" : \"return (empty)\", \n \"expression\" : { \n \"type\" : \"const list\", \n \"value\" : \"[ ]\" \n } \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "ExplainQuery"
}
],
"path": "/_api/explain"

View File

@ -16,7 +16,7 @@
"code": "202"
},
{
"reason": "is returned if it failed. The response body contains an error document in this case. <br><br>",
"reason": "is returned if it failed. The response body contains an error document in this case. <br><br> <em>Examples</em> <br><br>",
"code": "400"
}
],
@ -39,7 +39,7 @@
"notes": "Creates a new graph. <br><br> Returns an object with an attribute <em>graph</em> containing a list of all graph properties. <br><br>",
"summary": "create graph",
"httpMethod": "POST",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/\n{\"_key\":\"graph\",\"vertices\":\"vertices\",\"edges\":\"edges\"}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\netag: 124862887\n\n{ \n \"graph\" : { \n \"_id\" : \"_graphs/graph\", \n \"_rev\" : \"124862887\", \n \"_key\" : \"graph\", \n \"edgeDefinitions\" : [ \n { \n \"collection\" : \"edges\", \n \"from\" : [ \n \"vertices\" \n ], \n \"to\" : [ \n \"vertices\" \n ] \n } \n ] \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"examples": "<br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/\n{ \n \"_key\" : \"graph\", \n \"vertices\" : \"vertices\", \n \"edges\" : \"edges\" \n}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\netag: 918691334\n\n{ \n \"graph\" : { \n \"_id\" : \"_graphs/graph\", \n \"_rev\" : \"918691334\", \n \"_key\" : \"graph\", \n \"edgeDefinitions\" : [ \n { \n \"collection\" : \"edges\", \n \"from\" : [ \n \"vertices\" \n ], \n \"to\" : [ \n \"vertices\" \n ] \n } \n ] \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>",
"nickname": "createGraph"
}
],
@ -62,7 +62,7 @@
"code": "304"
},
{
"reason": "\"If-Match\" header or <em>rev</em> is given and the current graph has a different version. This response code may only be returned if <em>graph-name</em> is specified in the request. <br><br>",
"reason": "\"If-Match\" header or <em>rev</em> is given and the current graph has a different version. This response code may only be returned if <em>graph-name</em> is specified in the request. <br><br> <em>Examples</em> <br><br> get graph by name <br><br>",
"code": "412"
}
],
@ -90,7 +90,7 @@
"notes": "<br><br> If <em>graph-name</em> is specified, returns an object with an attribute <em>graph</em> containing a JSON hash with all properties of the specified graph. <br><br> If <em>graph-name</em> is not specified, returns a list of graph objects. <br><br>",
"summary": "get the properties of a specific or all graphs",
"httpMethod": "GET",
"examples": "<br><br> get graph by name <br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/graph/graph\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 125976999\n\n{ \n \"graph\" : { \n \"_id\" : \"_graphs/graph\", \n \"_rev\" : \"125976999\", \n \"_key\" : \"graph\", \n \"edgeDefinitions\" : [ \n { \n \"collection\" : \"edges\", \n \"from\" : [ \n \"vertices\" \n ], \n \"to\" : [ \n \"vertices\" \n ] \n } \n ] \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br> get all graphs <br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/graph\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"graphs\" : [ \n { \n \"_id\" : \"_graphs/graph1\", \n \"_rev\" : \"127484327\", \n \"_key\" : \"graph1\", \n \"edgeDefinitions\" : [ \n { \n \"collection\" : \"edges1\", \n \"from\" : [ \n \"vertices1\" \n ], \n \"to\" : [ \n \"vertices1\" \n ] \n } \n ] \n }, \n { \n \"_id\" : \"_graphs/graph2\", \n \"_rev\" : \"128401831\", \n \"_key\" : \"graph2\", \n \"edgeDefinitions\" : [ \n { \n \"collection\" : \"edges2\", \n \"from\" : [ \n \"vertices2\" \n ], \n \"to\" : [ \n \"vertices2\" \n ] \n } \n ] \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"examples": "<br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/graph/graph\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 920067590\n\n{ \n \"graph\" : { \n \"_id\" : \"_graphs/graph\", \n \"_rev\" : \"920067590\", \n \"_key\" : \"graph\", \n \"edgeDefinitions\" : [ \n { \n \"collection\" : \"edges\", \n \"from\" : [ \n \"vertices\" \n ], \n \"to\" : [ \n \"vertices\" \n ] \n } \n ] \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br> get all graphs <br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/graph\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"graphs\" : [ \n { \n \"_id\" : \"_graphs/graph2\", \n \"_rev\" : \"922885638\", \n \"_key\" : \"graph2\", \n \"edgeDefinitions\" : [ \n { \n \"collection\" : \"edges2\", \n \"from\" : [ \n \"vertices2\" \n ], \n \"to\" : [ \n \"vertices2\" \n ] \n } \n ] \n }, \n { \n \"_id\" : \"_graphs/graph1\", \n \"_rev\" : \"921837062\", \n \"_key\" : \"graph1\", \n \"edgeDefinitions\" : [ \n { \n \"collection\" : \"edges1\", \n \"from\" : [ \n \"vertices1\" \n ], \n \"to\" : [ \n \"vertices1\" \n ] \n } \n ] \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>",
"nickname": "getThePropertiesOfASpecificOrAllGraphs"
}
],
@ -113,7 +113,7 @@
"code": "404"
},
{
"reason": "\"If-Match\" header or <em>rev</em> is given and the current graph has a different version <br><br>",
"reason": "\"If-Match\" header or <em>rev</em> is given and the current graph has a different version <br><br> <em>Examples</em> <br><br> delete graph by name <br><br>",
"code": "412"
}
],
@ -135,7 +135,7 @@
"notes": "Deletes graph, edges and vertices <br><br>",
"summary": "delete graph",
"httpMethod": "DELETE",
"examples": "<br><br> delete graph by name <br><br><br><br><pre><code class=\"json\">unix> curl -X DELETE --dump - http://localhost:8529/_api/graph/graph\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"examples": "<br><br><pre><code class=\"json\">shell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/graph/graph\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>",
"nickname": "deleteGraph"
}
],
@ -150,7 +150,7 @@
"code": "201"
},
{
"reason": "is returned if the graph was created successfully and <em>waitForSync</em> was <em>false</em>. <br><br>",
"reason": "is returned if the graph was created successfully and <em>waitForSync</em> was <em>false</em>. <br><br> <em>Examples</em> <br><br>",
"code": "202"
}
],
@ -180,7 +180,7 @@
"notes": "Creates a vertex in a graph. <br><br> Returns an object with an attribute <em>vertex</em> containing a list of all vertex properties. <br><br>",
"summary": "create vertex",
"httpMethod": "POST",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertex\n{\"_key\":\"v1\",\"optional1\":\"val1\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 132268455\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"132268455\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
"examples": "<br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertex\n{ \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 927407622\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"927407622\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n</code></pre><br>",
"nickname": "createVertex"
}
],
@ -203,7 +203,7 @@
"code": "404"
},
{
"reason": "\"If-None-Match\" header or <em>rev</em> is given and the current graph has a different version <br><br>",
"reason": "\"If-None-Match\" header or <em>rev</em> is given and the current graph has a different version <br><br> <em>Examples</em> <br><br> get vertex properties by name <br><br>",
"code": "412"
}
],
@ -245,7 +245,7 @@
"notes": "Returns an object with an attribute <em>vertex</em> containing a list of all vertex properties. <br><br>",
"summary": "get vertex",
"httpMethod": "GET",
"examples": "<br><br> get vertex properties by name <br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 133972391\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"133972391\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"examples": "<br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 929308166\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"929308166\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>",
"nickname": "getVertex"
}
],
@ -268,7 +268,7 @@
"code": "404"
},
{
"reason": "\"If-Match\" header or <em>rev</em> is given and the current vertex has a different version <br><br>",
"reason": "\"If-Match\" header or <em>rev</em> is given and the current vertex has a different version <br><br> <em>Examples</em> <br><br>",
"code": "412"
}
],
@ -311,7 +311,7 @@
"notes": "Deletes vertex and all in and out edges of the vertex <br><br>",
"summary": "delete vertex",
"httpMethod": "DELETE",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X DELETE --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : true, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
"examples": "<br><br><pre><code class=\"json\">shell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : true, \n \"error\" : false, \n \"code\" : 202 \n}\n</code></pre><br>",
"nickname": "deleteVertex"
}
],
@ -334,7 +334,7 @@
"code": "404"
},
{
"reason": "\"If-Match\" header or <em>rev</em> is given and the current vertex has a different version <br><br>",
"reason": "\"If-Match\" header or <em>rev</em> is given and the current vertex has a different version <br><br> <em>Examples</em> <br><br>",
"code": "412"
}
],
@ -384,7 +384,7 @@
"notes": "Replaces the vertex properties. <br><br> Returns an object with an attribute <em>vertex</em> containing a list of all vertex properties. <br><br>",
"summary": "update vertex",
"httpMethod": "PUT",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n{\"optional1\":\"val2\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 138494375\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"138494375\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val2\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
"examples": "<br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n{ \n \"optional1\" : \"val2\" \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 934223366\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"934223366\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val2\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n</code></pre><br>",
"nickname": "updateVertex"
}
],
@ -407,7 +407,7 @@
"code": "404"
},
{
"reason": "\"If-Match\" header or <em>rev</em> is given and the current vertex has a different version <br><br>",
"reason": "\"If-Match\" header or <em>rev</em> is given and the current vertex has a different version <br><br> <em>Examples</em> <br><br>",
"code": "412"
}
],
@ -464,7 +464,7 @@
"notes": "Partially updates the vertex properties. <br><br> Setting an attribute value to <em>null</em> in the patch document will cause a value of <em>null</em> be saved for the attribute by default. If the intention is to delete existing attributes with the patch command, the URL parameter <em>keepNull</em> can be used with a value of <em>false</em>. 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 <em>null</em>. <br><br> Returns an object with an attribute <em>vertex</em> containing a list of all vertex properties. <br><br>",
"summary": "update vertex",
"httpMethod": "PATCH",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n{\"optional1\":\"vertexPatch\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 140722599\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"140722599\", \n \"_key\" : \"v1\", \n \"optional1\" : \"vertexPatch\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\nunix> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n{\"optional1\":null}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 141246887\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"141246887\", \n \"_key\" : \"v1\", \n \"optional1\" : null \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
"examples": "<br><br><pre><code class=\"json\">shell> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n{ \n \"optional1\" : \"vertexPatch\" \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 936648198\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"936648198\", \n \"_key\" : \"v1\", \n \"optional1\" : \"vertexPatch\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\nshell> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n{ \n \"optional1\" : null \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 937172486\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"937172486\", \n \"_key\" : \"v1\", \n \"optional1\" : null \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n</code></pre><br>",
"nickname": "updateVertex"
}
],
@ -475,7 +475,7 @@
{
"errorResponses": [
{
"reason": "is returned if the cursor was created <br><br>",
"reason": "is returned if the cursor was created <br><br> <em>Examples</em> <br><br> Select all vertices <br><br>",
"code": "201"
}
],
@ -498,7 +498,7 @@
"notes": "Returns a cursor. <br><br> The call expects a JSON hash array as body to filter the result: <br><br> <ul class=\"swagger-list\"><li><em>batchSize</em>: the batch size of the returned cursor <li><em>limit</em>: limit the result size <li><em>count</em>: return the total number of results (default \"false\") <li><em>filter</em>: a optional filter </ul> The attributes of filter <ul class=\"swagger-list\"><li><em>properties</em>: filter by an array of vertex properties </ul> The attributes of a property filter <ul class=\"swagger-list\"><li><em>key</em>: filter the result vertices by a key value pair <li><em>value</em>: the value of the <em>key</em> <li><em>compare</em>: a compare operator",
"summary": "get vertices",
"httpMethod": "POST",
"examples": "<br><br> Select all vertices <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertices\n{\"batchSize\":100}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"vertices/v5\", \n \"_rev\" : \"144523687\", \n \"_key\" : \"v5\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v2\", \n \"_rev\" : \"143344039\", \n \"_key\" : \"v2\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"142950823\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v4\", \n \"_rev\" : \"144130471\", \n \"_key\" : \"v4\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v3\", \n \"_rev\" : \"143737255\", \n \"_key\" : \"v3\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"examples": "<br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertices\n{ \n \"batchSize\" : 100 \n}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"vertices/v3\", \n \"_rev\" : \"939859462\", \n \"_key\" : \"v3\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v2\", \n \"_rev\" : \"939466246\", \n \"_key\" : \"v2\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v5\", \n \"_rev\" : \"940645894\", \n \"_key\" : \"v5\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v4\", \n \"_rev\" : \"940252678\", \n \"_key\" : \"v4\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"939073030\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>",
"nickname": "getVertices"
}
],
@ -509,7 +509,7 @@
{
"errorResponses": [
{
"reason": "is returned if the cursor was created <br><br>",
"reason": "is returned if the cursor was created <br><br> <em>Examples</em> <br><br> Select all vertices <br><br>",
"code": "201"
}
],
@ -521,6 +521,13 @@
"name": "graph-name",
"description": "The name of the graph <br><br>"
},
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "vertex-name",
"description": "The key of the vertex <br><br>"
},
{
"dataType": "Json",
"paramType": "body",
@ -532,11 +539,11 @@
"notes": "Returns a cursor. <br><br> The call expects a JSON hash array as body to filter the result: <br><br> <ul class=\"swagger-list\"><li><em>batchSize</em>: the batch size of the returned cursor <li><em>limit</em>: limit the result size <li><em>count</em>: return the total number of results (default \"false\") <li><em>filter</em>: a optional filter </ul> The attributes of filter <ul class=\"swagger-list\"><li><em>direction</em>: Filter for inbound (value \"in\") or outbound (value \"out\") neighbors. Default value is \"any\". <li><em>labels</em>: filter by an array of edge labels (empty array means no restriction) <li><em>properties</em>: filter neighbors by an array of edge properties </ul> The attributes of a property filter <ul class=\"swagger-list\"><li><em>key</em>: filter the result vertices by a key value pair <li><em>value</em>: the value of the <em>key</em> <li><em>compare</em>: a compare operator",
"summary": "get vertices",
"httpMethod": "POST",
"examples": "<br><br> Select all vertices <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertices/v2\n{\"batchSize\" : 100, \"filter\" : {\"direction\" : \"any\", \"properties\":[] }}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"146424231\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v4\", \n \"_rev\" : \"147603879\", \n \"_key\" : \"v4\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br><br><br> Select vertices by direction and property filter <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertices/v2\n{\"batchSize\" : 100, \"filter\" : {\"direction\" : \"out\", \"properties\":[ { \"key\": \"optional1\", \"value\": \"val2\", \"compare\" : \"==\" }, ] }}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"vertices/v4\", \n \"_rev\" : \"153436583\", \n \"_key\" : \"v4\", \n \"optional1\" : \"val2\" \n }, \n { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"152256935\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"examples": "<br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertices/v2\n{\"batchSize\" : 100, \"filter\" : {\"direction\" : \"any\", \"properties\":[] }}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"942743046\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v4\", \n \"_rev\" : \"943922694\", \n \"_key\" : \"v4\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br> Select vertices by direction and property filter <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/vertices/v2\n{\"batchSize\" : 100, \"filter\" : {\"direction\" : \"out\", \"properties\":[ { \"key\": \"optional1\", \"value\": \"val2\", \"compare\" : \"==\" }, ] }}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"vertices/v4\", \n \"_rev\" : \"949886470\", \n \"_key\" : \"v4\", \n \"optional1\" : \"val2\" \n }, \n { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"948706822\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>",
"nickname": "getVertices"
}
],
"path": "/_api/graph/{graph-name}/vertices/{vertice-name}"
"path": "/_api/graph/{graph-name}/vertices/{vertex-name}"
},
{
"operations": [
@ -547,7 +554,7 @@
"code": "201"
},
{
"reason": "is returned if the edge was created successfully and <em>waitForSync</em> was <em>false</em>. <br><br>",
"reason": "is returned if the edge was created successfully and <em>waitForSync</em> was <em>false</em>. <br><br> <em>Examples</em> <br><br>",
"code": "202"
}
],
@ -577,7 +584,7 @@
"notes": "Creates an edge in a graph. <br><br> The call expects a JSON hash array as body with the edge properties: <br><br> <ul class=\"swagger-list\"><li><em>_key</em>: The name of the edge (optional, if edge collection allows user defined keys). <li><em>_from</em>: The name of the from vertex. <li><em>_to</em>: The name of the to vertex. <li><em>$label</em>: A label for the edge (optional). <li>further optional attributes. </ul> Returns an object with an attribute <em>edge</em> containing the list of all edge properties. <br><br>",
"summary": "create edge",
"httpMethod": "POST",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edge\n{\"_key\":\"edge1\",\"_from\":\"vert2\",\"_to\":\"vert1\",\"optional1\":\"val1\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 159203751\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"159203751\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/vert2\", \n \"_to\" : \"vertices/vert1\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
"examples": "<br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edge\n{ \n \"_key\" : \"edge1\", \n \"_from\" : \"vert2\", \n \"_to\" : \"vert1\", \n \"optional1\" : \"val1\" \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 955719174\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"955719174\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/vert2\", \n \"_to\" : \"vertices/vert1\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n</code></pre><br>",
"nickname": "createEdge"
}
],
@ -600,7 +607,7 @@
"code": "404"
},
{
"reason": "\"If-None-Match\" header or <em>rev</em> is given and the current edge has a different version <br><br>",
"reason": "\"If-None-Match\" header or <em>rev</em> is given and the current edge has a different version <br><br> <em>Examples</em> <br><br>",
"code": "412"
}
],
@ -642,7 +649,7 @@
"notes": "Returns an object with an attribute <em>edge</em> containing a list of all edge properties. <br><br>",
"summary": "get edge",
"httpMethod": "GET",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/graph/graph/edge/edge1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 162021799\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"162021799\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/vert1\", \n \"_to\" : \"vertices/vert2\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"examples": "<br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edge/edge1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 958668294\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"958668294\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/vert1\", \n \"_to\" : \"vertices/vert2\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>",
"nickname": "getEdge"
}
],
@ -665,7 +672,7 @@
"code": "404"
},
{
"reason": "\"If-Match\" header or <em>rev</em> is given and the current edge has a different version <br><br>",
"reason": "\"If-Match\" header or <em>rev</em> is given and the current edge has a different version <br><br> <em>Examples</em> <br><br>",
"code": "412"
}
],
@ -708,7 +715,7 @@
"notes": "Deletes an edge of the graph <br><br>",
"summary": "delete edge",
"httpMethod": "DELETE",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X DELETE --dump - http://localhost:8529/_api/graph/graph/edge/edge1\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : true, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
"examples": "<br><br><pre><code class=\"json\">shell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edge/edge1\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : true, \n \"error\" : false, \n \"code\" : 202 \n}\n</code></pre><br>",
"nickname": "deleteEdge"
}
],
@ -731,7 +738,7 @@
"code": "404"
},
{
"reason": "\"If-Match\" header or <em>rev</em> is given and the current edge has a different version <br><br>",
"reason": "\"If-Match\" header or <em>rev</em> is given and the current edge has a different version <br><br> <em>Examples</em> <br><br>",
"code": "412"
}
],
@ -781,7 +788,7 @@
"notes": "Replaces the optional edge properties. <br><br> The call expects a JSON hash array as body with the new edge properties. <br><br> Returns an object with an attribute <em>edge</em> containing a list of all edge properties. <br><br>",
"summary": "update edge",
"httpMethod": "PUT",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edge/edge1\n{\"optional1\":\"val2\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 168903079\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"168903079\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/vert1\", \n \"_to\" : \"vertices/vert2\", \n \"$label\" : null, \n \"optional1\" : \"val2\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
"examples": "<br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edge/edge1\n{ \n \"optional1\" : \"val2\" \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 965811718\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"965811718\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/vert1\", \n \"_to\" : \"vertices/vert2\", \n \"$label\" : null, \n \"optional1\" : \"val2\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n</code></pre><br>",
"nickname": "updateEdge"
}
],
@ -804,7 +811,7 @@
"code": "404"
},
{
"reason": "\"If-Match\" header or <em>rev</em> is given and the current edge has a different version <br><br>",
"reason": "\"If-Match\" header or <em>rev</em> is given and the current edge has a different version <br><br> <em>Examples</em> <br><br>",
"code": "412"
}
],
@ -861,7 +868,7 @@
"notes": "Partially updates the edge properties. <br><br> Setting an attribute value to <em>null</em> in the patch document will cause a value of <em>null</em> be saved for the attribute by default. If the intention is to delete existing attributes with the patch command, the URL parameter <em>keepNull</em> can be used with a value of <em>false</em>. 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 <em>null</em>. <br><br> Returns an object with an attribute <em>edge</em> containing a list of all edge properties. <br><br>",
"summary": "update edge",
"httpMethod": "PATCH",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edge/edge1\n{\"optional3\":\"val3\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 172376487\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"172376487\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/vert1\", \n \"_to\" : \"vertices/vert2\", \n \"$label\" : null, \n \"optional1\" : \"val1\", \n \"optional3\" : \"val3\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
"examples": "<br><br><pre><code class=\"json\">shell> curl -X PATCH --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edge/edge1\n{ \n \"optional3\" : \"val3\" \n}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 969416198\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"969416198\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/vert1\", \n \"_to\" : \"vertices/vert2\", \n \"$label\" : null, \n \"optional1\" : \"val1\", \n \"optional3\" : \"val3\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n</code></pre><br>",
"nickname": "updateEdge"
}
],
@ -872,7 +879,7 @@
{
"errorResponses": [
{
"reason": "is returned if the cursor was created <br><br>",
"reason": "is returned if the cursor was created <br><br> <em>Examples</em> <br><br> Select all edges <br><br>",
"code": "201"
}
],
@ -895,7 +902,7 @@
"notes": "Returns a cursor. <br><br> The call expects a JSON hash array as body to filter the result: <br><br> <ul class=\"swagger-list\"><li><em>batchSize</em>: the batch size of the returned cursor <li><em>limit</em>: limit the result size <li><em>count</em>: return the total number of results (default \"false\") <li><em>filter</em>: a optional filter </ul> The attributes of filter <ul class=\"swagger-list\"><li><em>labels</em>: filter by an array of edge labels <li><em>properties</em>: filter by an array of edge properties </ul> The attributes of a property filter <ul class=\"swagger-list\"><li><em>key</em>: filter the result edges by a key value pair <li><em>value</em>: the value of the <em>key</em> <li><em>compare</em>: a compare operator",
"summary": "get edges",
"httpMethod": "POST",
"examples": "<br><br> Select all edges <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edges\n{\"batchSize\":100}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"edges/edge4\", \n \"_rev\" : \"178012583\", \n \"_key\" : \"edge4\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v5\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"176439719\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v2\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge3\", \n \"_rev\" : \"177488295\", \n \"_key\" : \"edge3\", \n \"_from\" : \"vertices/v2\", \n \"_to\" : \"vertices/v4\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge2\", \n \"_rev\" : \"176964007\", \n \"_key\" : \"edge2\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v3\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"examples": "<br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edges\n{ \n \"batchSize\" : 100 \n}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"edges/edge2\", \n \"_rev\" : \"974134790\", \n \"_key\" : \"edge2\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v3\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge3\", \n \"_rev\" : \"974659078\", \n \"_key\" : \"edge3\", \n \"_from\" : \"vertices/v2\", \n \"_to\" : \"vertices/v4\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"973610502\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v2\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge4\", \n \"_rev\" : \"975183366\", \n \"_key\" : \"edge4\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v5\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>",
"nickname": "getEdges"
}
],
@ -906,7 +913,7 @@
{
"errorResponses": [
{
"reason": "is returned if the cursor was created <br><br>",
"reason": "is returned if the cursor was created <br><br> <em>Examples</em> <br><br> Select all edges <br><br>",
"code": "201"
}
],
@ -936,7 +943,7 @@
"notes": "<br><br> Returns a cursor. <br><br> The call expects a JSON hash array as body to filter the result: <br><br> <ul class=\"swagger-list\"><li><em>batchSize</em>: the batch size of the returned cursor <li><em>limit</em>: limit the result size <li><em>count</em>: return the total number of results (default \"false\") <li><em>filter</em>: a optional filter </ul> The attributes of filter <ul class=\"swagger-list\"><li><em>direction</em>: Filter for inbound (value \"in\") or outbound (value \"out\") neighbors. Default value is \"any\". <li><em>labels</em>: filter by an array of edge labels <li><em>properties</em>: filter neighbors by an array of properties </ul> The attributes of a property filter <ul class=\"swagger-list\"><li><em>key</em>: filter the result vertices by a key value pair <li><em>value</em>: the value of the <em>key</em> <li><em>compare</em>: a compare operator",
"summary": "get edges",
"httpMethod": "POST",
"examples": "<br><br> Select all edges <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edges/v2\n{\"batchSize\" : 100, \"filter\" : { \"direction\" : \"any\" }}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"182272423\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v2\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge3\", \n \"_rev\" : \"183320999\", \n \"_key\" : \"edge3\", \n \"_from\" : \"vertices/v2\", \n \"_to\" : \"vertices/v4\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"examples": "<br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/graph/graph/edges/v2\n{\"batchSize\" : 100, \"filter\" : { \"direction\" : \"any\" }}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"979574278\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v2\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge3\", \n \"_rev\" : \"980622854\", \n \"_key\" : \"edge3\", \n \"_from\" : \"vertices/v2\", \n \"_to\" : \"vertices/v4\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>",
"nickname": "getEdges"
}
],

File diff suppressed because one or more lines are too long

View File

@ -17,10 +17,10 @@
}
],
"notes": "<br><br> Returns an object with an attribute <em>indexes</em> containing a list of all index descriptions for the given collection. The same information is also available in the <em>identifiers</em> as hash map with the index handle as keys. <br><br>",
"summary": "reads all indexes of a collection",
"summary": " Read all indexes of a collection",
"httpMethod": "GET",
"examples": "<br><br> Return information about all indexes: <br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/index?collection=products\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"indexes\" : [ \n { \n \"id\" : \"products/0\", \n \"type\" : \"primary\", \n \"unique\" : true, \n \"fields\" : [ \n \"_id\" \n ] \n } \n ], \n \"identifiers\" : { \n \"products/0\" : { \n \"id\" : \"products/0\", \n \"type\" : \"primary\", \n \"unique\" : true, \n \"fields\" : [ \n \"_id\" \n ] \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "readsAllIndexesOfACollection"
"examples": "<br><br> Return information about all indexes: <br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"indexes\" : [ \n { \n \"id\" : \"products/0\", \n \"type\" : \"primary\", \n \"unique\" : true, \n \"fields\" : [ \n \"_key\" \n ] \n } \n ], \n \"identifiers\" : { \n \"products/0\" : { \n \"id\" : \"products/0\", \n \"type\" : \"primary\", \n \"unique\" : true, \n \"fields\" : [ \n \"_key\" \n ] \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "ReadAllIndexesOfACollection"
}
],
"path": "/_api/index"
@ -48,10 +48,10 @@
}
],
"notes": "<br><br> The result is an objects describing the index. It has at least the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>id</em>: The identifier of the index. </ul> All other attributes are type-dependent. <br><br>",
"summary": "reads an index",
"summary": "Read index",
"httpMethod": "GET",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/index/products/0\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/0\", \n \"type\" : \"primary\", \n \"unique\" : true, \n \"fields\" : [ \n \"_id\" \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "readsAnIndex"
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/index/products/0\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/0\", \n \"type\" : \"primary\", \n \"unique\" : true, \n \"fields\" : [ \n \"_key\" \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "ReadIndex"
}
],
"path": "/_api/index/{index-handle}"
@ -93,11 +93,11 @@
"description": "<br><br>"
}
],
"notes": "<br><br> Creates a cap constraint for the collection <em>collection-name</em>, if it does not already exist. Expects an object containing the index details. <br><br> <ul class=\"swagger-list\"><li><em>type</em>: must be equal to <em>\"cap\"</em>. <li><em>size</em>: The maximal number of documents for the collection. If specified, the value must be greater than zero. <li><em>byteSize</em>: The maximal size of the active document data in the collection (in bytes). If specified, the value must be at least 16384. </ul> Note that the cap constraint does not index particular attributes of the documents in a collection, but limits the number of documents in the collection to a maximum value. The cap constraint thus does not support attribute names specified in the <em>fields</em> attribute nor uniqueness of any kind via the <em>unique</em> attribute. <br><br> It is allowed to specify either <em>size</em> or <em>byteSize</em>, or both at the same time. If both are specified, then the automatic document removal will be triggered by the first non-met constraint. <br><br>",
"summary": "creates a cap constraint",
"notes": "<br><br> Creates a cap constraint for the collection <em>collection-name</em>, if it does not already exist. Expects an object containing the index details. <br><br> <ul class=\"swagger-list\"><li><em>type</em>: must be equal to <em>\"cap\"</em>. <li><em>size</em>: The maximal number of documents for the collection. If specified, the value must be greater than zero. <li><em>byteSize</em>: The maximal size of the active document data in the collection (in bytes). If specified, the value must be at least 16384. </ul> <em>*Note*</em>: The cap constraint does not index particular attributes of the documents in a collection, but limits the number of documents in the collection to a maximum value. The cap constraint thus does not support attribute names specified in the <em>fields</em> attribute nor uniqueness of any kind via the <em>unique</em> attribute. <br><br> It is allowed to specify either <em>size</em> or <em>byteSize</em>, or both at the same time. If both are specified, then the automatic document removal will be triggered by the first non-met constraint. <br><br>",
"summary": " Create cap constraint",
"httpMethod": "POST",
"examples": "<br><br> Creating a cap constraint <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{\"type\":\"cap\",\"size\":10}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/184893863\", \n \"type\" : \"cap\", \n \"unique\" : false, \n \"size\" : 10, \n \"byteSize\" : 0, \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"nickname": "createsACapConstraint"
"examples": "<br><br> Creating a cap constraint <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{\"type\":\"cap\",\"size\":10}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/982720006\", \n \"type\" : \"cap\", \n \"unique\" : false, \n \"size\" : 10, \n \"byteSize\" : 0, \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "CreateCapConstraint"
}
],
"path": "/_api/index"
@ -135,11 +135,11 @@
"description": "<br><br>"
}
],
"notes": "<br><br> Creates a geo-spatial index in the collection <em>collection-name</em>, if it does not already exist. Expects an object containing the index details. <br><br> <ul class=\"swagger-list\"><li><em>type</em>: must be equal to <em>\"geo\"</em>. <li><em>fields</em>: A list with one or two attribute paths. If it is a list with one attribute path <em>location</em>, then a geo-spatial index on all documents is created using <em>location</em> as path to the coordinates. The value of the attribute must be a list with at least two double values. The list must contain the latitude (first value) and the longitude (second value). All documents, which do not have the attribute path or with value that are not suitable, are ignored. If it is a list with two attribute paths <em>latitude</em> and <em>longitude</em>, then a geo-spatial index on all documents is created using <em>latitude</em> and <em>longitude</em> as paths the latitude and the longitude. The value of the attribute <em>latitude</em> and of the attribute <em>longitude</em> must a double. All documents, which do not have the attribute paths or which values are not suitable, are ignored. <li><em>geoJson</em>: If a geo-spatial index on a <em>location</em> is constructed and <em>geoJson</em> is <em>true</em>, then the order within the list is longitude followed by latitude. This corresponds to the format described in http://geojson.org/geojson-spec.html#positions <li><em>constraint</em>: If <em>constraint</em> is <em>true</em>, then a geo-spatial constraint is created. The constraint is a non-unique variant of the index. Note that it is also possible to set the <em>unique</em> attribute instead of the <em>constraint</em> attribute. <li><em>ignoreNull</em>: If a geo-spatial constraint is created and <em>ignoreNull</em> is true, then documents with a null in <em>location</em> or at least one null in <em>latitude</em> or <em>longitude</em> are ignored. </ul> Note: unique indexes on non-shard keys are not supported in a cluster. <br><br>",
"summary": "creates a geo-spatial index",
"notes": "<br><br> Creates a geo-spatial index in the collection <em>collection-name</em>, if it does not already exist. Expects an object containing the index details. <br><br> <ul class=\"swagger-list\"><li><em>type</em>: must be equal to <em>\"geo\"</em>. <li><em>fields</em>: A list with one or two attribute paths. If it is a list with one attribute path <em>location</em>, then a geo-spatial index on all documents is created using <em>location</em> as path to the coordinates. The value of the attribute must be a list with at least two double values. The list must contain the latitude (first value) and the longitude (second value). All documents, which do not have the attribute path or with value that are not suitable, are ignored. If it is a list with two attribute paths <em>latitude</em> and <em>longitude</em>, then a geo-spatial index on all documents is created using <em>latitude</em> and <em>longitude</em> as paths the latitude and the longitude. The value of the attribute <em>latitude</em> and of the attribute <em>longitude</em> must a double. All documents, which do not have the attribute paths or which values are not suitable, are ignored. <li><em>geoJson</em>: If a geo-spatial index on a <em>location</em> is constructed and <em>geoJson</em> is <em>true</em>, then the order within the list is longitude followed by latitude. This corresponds to the format described in http://geojson.org/geojson-spec.html#positions <li><em>constraint</em>: If <em>constraint</em> is <em>true</em>, then a geo-spatial constraint is created. The constraint is a non-unique variant of the index. <em>*Note*</em>: It is also possible to set the <em>unique</em> attribute instead of the <em>constraint</em> attribute. <li><em>ignoreNull</em>: If a geo-spatial constraint is created and <em>ignoreNull</em> is true, then documents with a null in <em>location</em> or at least one null in <em>latitude</em> or <em>longitude</em> are ignored. </ul> <em>*Note*</em>: Unique indexes on non-shard keys are not supported in a cluster. <br><br>",
"summary": " Create geo-spatial index",
"httpMethod": "POST",
"examples": "<br><br> Creating a geo index with a location attribute: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"geo\", \"fields\" : [ \"b\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/185221543\", \n \"type\" : \"geo1\", \n \"unique\" : false, \n \"geoJson\" : false, \n \"constraint\" : false, \n \"ignoreNull\" : false, \n \"fields\" : [ \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br><br><br> Creating a geo index with latitude and longitude attributes: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"geo\", \"fields\" : [ \"e\", \"f\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/185614759\", \n \"type\" : \"geo2\", \n \"unique\" : false, \n \"constraint\" : false, \n \"ignoreNull\" : false, \n \"fields\" : [ \n \"e\", \n \"f\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"nickname": "createsAGeo-spatialIndex"
"examples": "<br><br> Creating a geo index with a location attribute: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"geo\", \"fields\" : [ \"b\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/983244294\", \n \"type\" : \"geo1\", \n \"unique\" : false, \n \"geoJson\" : false, \n \"constraint\" : false, \n \"ignoreNull\" : false, \n \"fields\" : [ \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br> Creating a geo index with latitude and longitude attributes: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"geo\", \"fields\" : [ \"e\", \"f\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/983768582\", \n \"type\" : \"geo2\", \n \"unique\" : false, \n \"constraint\" : false, \n \"ignoreNull\" : false, \n \"fields\" : [ \n \"e\", \n \"f\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "CreateGeo-spatialIndex"
}
],
"path": "/_api/index"
@ -181,11 +181,11 @@
"description": "<br><br>"
}
],
"notes": "<br><br> Creates a hash index for the collection <em>collection-name</em>, if it does not already exist. The call expects an object containing the index details. <br><br> <ul class=\"swagger-list\"><li><em>type</em>: must be equal to <em>\"hash\"</em>. <li><em>fields</em>: A list of attribute paths. <li><em>unique</em>: If <em>true</em>, then create a unique index. </ul> Note: unique indexes on non-shard keys are not supported in a cluster. <br><br>",
"summary": "creates a hash index",
"notes": "<br><br> Creates a hash index for the collection <em>collection-name</em>, if it does not already exist. The call expects an object containing the index details. <br><br> <ul class=\"swagger-list\"><li><em>type</em>: must be equal to <em>\"hash\"</em>. <li><em>fields</em>: A list of attribute paths. <li><em>unique</em>: If <em>true</em>, then create a unique index. </ul> <em>*Note*</em>: unique indexes on non-shard keys are not supported in a cluster. <br><br>",
"summary": " Create hash index",
"httpMethod": "POST",
"examples": "<br><br> Creating an unique constraint: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"hash\", \"unique\" : true, \"fields\" : [ \"a\", \"b\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/186007975\", \n \"type\" : \"hash\", \n \"unique\" : true, \n \"fields\" : [ \n \"a\", \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br><br><br> Creating a hash index: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"hash\", \"unique\" : false, \"fields\" : [ \"a\", \"b\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/186401191\", \n \"type\" : \"hash\", \n \"unique\" : false, \n \"fields\" : [ \n \"a\", \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"nickname": "createsAHashIndex"
"examples": "<br><br> Creating an unique constraint: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"hash\", \"unique\" : true, \"fields\" : [ \"a\", \"b\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/984292870\", \n \"type\" : \"hash\", \n \"unique\" : true, \n \"fields\" : [ \n \"a\", \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br> Creating a hash index: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"hash\", \"unique\" : false, \"fields\" : [ \"a\", \"b\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/984817158\", \n \"type\" : \"hash\", \n \"unique\" : false, \n \"fields\" : [ \n \"a\", \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "CreateHashIndex"
}
],
"path": "/_api/index"
@ -227,11 +227,11 @@
"description": "<br><br>"
}
],
"notes": "<br><br> Creates a skip-list index for the collection <em>collection-name</em>, if it does not already exist. The call expects an object containing the index details. <br><br> <ul class=\"swagger-list\"><li><em>type</em>: must be equal to <em>\"skiplist\"</em>. <li><em>fields</em>: A list of attribute paths. <li><em>unique</em>: If <em>true</em>, then create a unique index. </ul> Note: unique indexes on non-shard keys are not supported in a cluster. <br><br>",
"summary": "creates a skip list",
"notes": "<br><br> Creates a skip-list index for the collection <em>collection-name</em>, if it does not already exist. The call expects an object containing the index details. <br><br> <ul class=\"swagger-list\"><li><em>type</em>: must be equal to <em>\"skiplist\"</em>. <li><em>fields</em>: A list of attribute paths. <li><em>unique</em>: If <em>true</em>, then create a unique index. </ul> <em>*Note*</em>: unique indexes on non-shard keys are not supported in a cluster. <br><br>",
"summary": " Create skip list",
"httpMethod": "POST",
"examples": "<br><br> Creating a skiplist: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"skiplist\", \"unique\" : false, \"fields\" : [ \"a\", \"b\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/186794407\", \n \"type\" : \"skiplist\", \n \"unique\" : false, \n \"fields\" : [ \n \"a\", \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"nickname": "createsASkipList"
"examples": "<br><br> Creating a skiplist: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"skiplist\", \"unique\" : false, \"fields\" : [ \"a\", \"b\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/985341446\", \n \"type\" : \"skiplist\", \n \"unique\" : false, \n \"fields\" : [ \n \"a\", \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "CreateSkipList"
}
],
"path": "/_api/index"
@ -270,10 +270,10 @@
}
],
"notes": "<br><br> Creates a fulltext index for the collection <em>collection-name</em>, if it does not already exist. The call expects an object containing the index details. <br><br> <ul class=\"swagger-list\"><li><em>type</em>: must be equal to <em>\"fulltext\"</em>. <li><em>fields</em>: A list of attribute names. Currently, the list is limited to exactly one attribute, so the value of <em>fields</em> should look like this for example: <em>[ \"text\" ]</em>. <li><em>minLength</em>: Minimum character length of words to index. Will default to a server-defined value if unspecified. It is thus recommended to set this value explicitly when creating the index.",
"summary": "creates a fulltext index",
"summary": " Create fulltext index",
"httpMethod": "POST",
"examples": "<br><br> Creating a fulltext index: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\" : \"fulltext\", \"fields\" : [ \"text\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/187122087\", \n \"type\" : \"fulltext\", \n \"unique\" : false, \n \"minLength\" : 2, \n \"fields\" : [ \n \"text\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"nickname": "createsAFulltextIndex"
"examples": "<br><br> Creating a fulltext index: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\" : \"fulltext\", \"fields\" : [ \"text\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/985800198\", \n \"type\" : \"fulltext\", \n \"unique\" : false, \n \"minLength\" : 2, \n \"fields\" : [ \n \"text\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "CreateFulltextIndex"
}
],
"path": "/_api/index"
@ -312,10 +312,10 @@
}
],
"notes": "<br><br> Creates a bitarray index for the collection <em>collection-name</em>, if it does not already exist. The call expects an object containing the index details. <br><br> <ul class=\"swagger-list\"><li><em>type</em>: must be equal to <em>\"bitarray\"</em>. <li><em>fields</em>: A list of pairs. A pair consists of an attribute path followed by a list of values. <li><em>unique</em>: Must always be set to <em>false</em>.",
"summary": "creates a bitarray index",
"summary": " Create bitarray index",
"httpMethod": "POST",
"examples": "<br><br> Creating a bitarray index: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\" : \"bitarray\", \"unique\" : false, \"fields\" : [ \"x\", [0,1,[]], \"y\", [\"a\",\"b\",[]] ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/187515303\", \n \"type\" : \"bitarray\", \n \"unique\" : false, \n \"fields\" : [ \n [ \n \"x\", \n [ \n 0, \n 1, \n [ ] \n ] \n ], \n [ \n \"y\", \n [ \n \"a\", \n \"b\", \n [ ] \n ] \n ] \n ], \n \"undefined\" : false, \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"nickname": "createsABitarrayIndex"
"examples": "<br><br> Creating a bitarray index: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\" : \"bitarray\", \"unique\" : false, \"fields\" : [ \"x\", [0,1,[]], \"y\", [\"a\",\"b\",[]] ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/986324486\", \n \"type\" : \"bitarray\", \n \"unique\" : false, \n \"fields\" : [ \n [ \n \"x\", \n [ \n 0, \n 1, \n [ ] \n ] \n ], \n [ \n \"y\", \n [ \n \"a\", \n \"b\", \n [ ] \n ] \n ] \n ], \n \"undefined\" : false, \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "CreateBitarrayIndex"
}
],
"path": "/_api/index"
@ -337,7 +337,7 @@
"code": "400"
},
{
"reason": "If <em>collection</em> is unknown, then an <em>HTTP 404</em> is returned.",
"reason": "If <em>collection</em> is unknown, then an <em>HTTP 404</em> is returned. @endDocuBlock",
"code": "404"
}
],
@ -357,11 +357,11 @@
"description": "<br><br>"
}
],
"notes": "<br><br> Creates a new index in the collection <em>collection</em>. Expects an object containing the index details. <br><br> The type of the index to be created must specified in the <em>type</em> attribute of the index details. Depending on the index type, additional other attributes may need to specified in the request in order to create the index. <br><br> See the manual, the manual, the manual, the manual, and the manual for details. <br><br> Most indexes (a notable exception being the cap constraint) require the list of attributes to be indexed in the <em>fields</em> attribute of the index details. Depending on the index type, a single attribute or multiple attributes may be indexed. <br><br> Indexing system attributes such as <em>_id</em>, <em>_key</em>, <em>_from</em>, and <em>_to</em> is not supported by any index type. Manually creating an index that relies on any of these attributes is unsupported. <br><br> Some indexes can be created as unique or non-unique variants. Uniqueness can be controlled for most indexes by specifying the <em>unique</em> in the index details. Setting it to <em>true</em> will create a unique index. Setting it to <em>false</em> or omitting the <em>unique</em> attribute will create a non-unique index. <br><br> Note that the following index types do not support uniqueness, and using the <em>unique</em> attribute with these types may lead to an error: <ul class=\"swagger-list\"><li>cap constraints <li>fulltext indexes <li>bitarray indexes </ul> Note also that unique indexes on non-shard keys are not supported in a cluster. <br><br>",
"summary": "creates an index",
"notes": "<br><br> Creates a new index in the collection <em>collection</em>. Expects an object containing the index details. <br><br> The type of the index to be created must specified in the <em>type</em> attribute of the index details. Depending on the index type, additional other attributes may need to specified in the request in order to create the index. <br><br> Most indexes (a notable exception being the cap constraint) require the list of attributes to be indexed in the <em>fields</em> attribute of the index details. Depending on the index type, a single attribute or multiple attributes may be indexed. <br><br> Indexing system attributes such as <em>_id</em>, <em>_key</em>, <em>_from</em>, and <em>_to</em> is not supported by any index type. Manually creating an index that relies on any of these attributes is unsupported. <br><br> Some indexes can be created as unique or non-unique variants. Uniqueness can be controlled for most indexes by specifying the <em>unique</em> in the index details. Setting it to <em>true</em> will create a unique index. Setting it to <em>false</em> or omitting the <em>unique</em> attribute will create a non-unique index. <br><br> <em>*Note*</em>: The following index types do not support uniqueness, and using the <em>unique</em> attribute with these types may lead to an error: <ul class=\"swagger-list\"><li>cap constraints <li>fulltext indexes <li>bitarray indexes </ul> <em>*Note*</em>: Unique indexes on non-shard keys are not supported in a cluster. <br><br>",
"summary": " Create index",
"httpMethod": "POST",
"examples": "",
"nickname": "createsAnIndex"
"nickname": "CreateIndex"
}
],
"path": "/_api/index"
@ -389,10 +389,10 @@
}
],
"notes": "<br><br> Deletes an index with <em>index-handle</em>. <br><br>",
"summary": "deletes an index",
"summary": " Delete index",
"httpMethod": "DELETE",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X DELETE --dump - http://localhost:8529/_api/index/products/187908519\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/187908519\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "deletesAnIndex"
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/index/products/986848774\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/986848774\", \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "DeleteIndex"
}
],
"path": "/_api/index/{index-handle}"

View File

@ -16,7 +16,7 @@
"code": "403"
},
{
"reason": "is returned if the server cannot generate the result due to an out-of-memory error.",
"reason": "is returned if the server cannot generate the result due to an out-of-memory error. @endDocuBlock",
"code": "500"
}
],
@ -72,10 +72,10 @@
}
],
"notes": "Returns fatal, error, warning or info log messages from the server's global log. The result is a JSON object with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>lid</em>: a list of log entry identifiers. Each log message is uniquely identified by its <b>lid</b> and the identifiers are in ascending order. <li><em>level</em>: a list of the log-levels for all log entries. <li><em>timestamp</em>: a list of the timestamps as seconds since 1970-01-01 for all log entries. <li><em>text</em> a list of the texts of all log entries <li><em>totalAmount</em>: the total amount of log entries before pagination.",
"summary": "reads the global log from the server",
"summary": " Read global log from the server",
"httpMethod": "GET",
"examples": "",
"nickname": "readsTheGlobalLogFromTheServer"
"nickname": "ReadGlobalLogFromTheServer"
}
],
"path": "/_admin/log"

View File

@ -22,14 +22,14 @@
"paramType": "body",
"required": "true",
"name": "query",
"description": "<br><br>"
"description": "To validate a query string without executing it, the query string can be passed to the server via an HTTP POST request. <br><br> These query string needs to be passed in the attribute <em>query</em> of a JSON object as the body of the POST request. <br><br>"
}
],
"notes": "<br><br> To validate a query string without executing it, the query string can be passed to the server via an HTTP POST request. <br><br> These query string needs to be passed in the attribute <em>query</em> of a JSON object as the body of the POST request. <br><br>",
"summary": "parses a query",
"notes": "",
"summary": " Parse query",
"httpMethod": "POST",
"examples": "<br><br> Valid query: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/query\n{ \"query\" : \"FOR p IN products FILTER p.name == @name LIMIT 2 RETURN p.n\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"bindVars\" : [ \n \"name\" \n ], \n \"collections\" : [ \n \"products\" \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br> Invalid query: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/query\n{ \"query\" : \"FOR p IN products FILTER p.name = @name LIMIT 2 RETURN p.n\" }\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1501, \n \"errorMessage\" : \"syntax error, unexpected assignment near '= @name LIMIT 2 RETURN p.n' at positio...\" \n}\n\n</code></pre><br>",
"nickname": "parsesAQuery"
"examples": "<br><br> Valid query: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/query\n{ \"query\" : \"FOR p IN products FILTER p.name == @name LIMIT 2 RETURN p.n\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"bindVars\" : [ \n \"name\" \n ], \n \"collections\" : [ \n \"products\" \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br> Invalid query: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/query\n{ \"query\" : \"FOR p IN products FILTER p.name = @name LIMIT 2 RETURN p.n\" }\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1501, \n \"errorMessage\" : \"syntax error, unexpected assignment near '= @name LIMIT 2 RETURN p.n' at position 1:33\" \n}\n</code></pre><br>@endDocuBlock",
"nickname": "ParseQuery"
}
],
"path": "/_api/query"

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
"code": "400"
},
{
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. The same error code is also returned if an invalid index id or type is used. <br><br>",
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. The same error code is also returned if an invalid index id or type is used. @endDocuBlock",
"code": "404"
}
],
@ -29,11 +29,11 @@
"description": "Contains the query specification. <br><br>"
}
],
"notes": "<br><br> This will find all documents matching a given example, using the specified hash index. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>index</em>: The id of the index to be used for the query. The index must exist and must be of type <em>hash</em>. <li><em>example</em>: an example document. The example must contain a value for each attribute in the index. <li><em>skip</em>: The number of documents to skip in the query. (optional) <li><em>limit</em>: The maximal number of documents to return. (optional) </ul> Returns a cursor containing the result, see the manual for details. <br><br>",
"summary": "executes query by-example using a hash index",
"notes": "<br><br> This will find all documents matching a given example, using the specified hash index. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>index</em>: The id of the index to be used for the query. The index must exist and must be of type <em>hash</em>. <li><em>example</em>: an example document. The example must contain a value for each attribute in the index. <li><em>skip</em>: The number of documents to skip in the query. (optional) <li><em>limit</em>: The maximal number of documents to return. (optional) </ul> Returns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details. <br><br>",
"summary": " Hash index",
"httpMethod": "PUT",
"examples": "",
"nickname": "executesQueryBy-exampleUsingAHashIndex"
"nickname": "HashIndex"
}
],
"path": "/_api/simple/by-example-hash"
@ -51,7 +51,7 @@
"code": "400"
},
{
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. The same error code is also returned if an invalid index id or type is used. <br><br>",
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. The same error code is also returned if an invalid index id or type is used. @endDocuBlock",
"code": "404"
}
],
@ -64,11 +64,11 @@
"description": "Contains the query specification. <br><br>"
}
],
"notes": "<br><br> This will find all documents matching a given example, using the specified skiplist index. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>index</em>: The id of the index to be used for the query. The index must exist and must be of type <em>skiplist</em>. <li><em>example</em>: an example document. The example must contain a value for each attribute in the index. <li><em>skip</em>: The number of documents to skip in the query. (optional) <li><em>limit</em>: The maximal number of documents to return. (optional) </ul> Returns a cursor containing the result, see the manual for details. <br><br>",
"summary": "executes query by-example using a skiplist index",
"notes": "<br><br> This will find all documents matching a given example, using the specified skiplist index. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>index</em>: The id of the index to be used for the query. The index must exist and must be of type <em>skiplist</em>. <li><em>example</em>: an example document. The example must contain a value for each attribute in the index. <li><em>skip</em>: The number of documents to skip in the query. (optional) <li><em>limit</em>: The maximal number of documents to return. (optional) </ul> Returns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details. <br><br>",
"summary": " Skiplist index",
"httpMethod": "PUT",
"examples": "",
"nickname": "executesQueryBy-exampleUsingASkiplistIndex"
"nickname": "SkiplistIndex"
}
],
"path": "/_api/simple/by-example-skiplist"
@ -86,7 +86,7 @@
"code": "400"
},
{
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. The same error code is also returned if an invalid index id or type is used. <br><br>",
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. The same error code is also returned if an invalid index id or type is used. @endDocuBlock",
"code": "404"
}
],
@ -99,11 +99,11 @@
"description": "Contains the query specification. <br><br>"
}
],
"notes": "<br><br> This will find all documents matching a given example, using the specified skiplist index. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>index</em>: The id of the index to be used for the query. The index must exist and must be of type <em>bitarray</em>. <li><em>example</em>: an example document. The example must contain a value for each attribute in the index. <li><em>skip</em>: The number of documents to skip in the query. (optional) <li><em>limit</em>: The maximal number of documents to return. (optional) </ul> Returns a cursor containing the result, see the manual for details. <br><br>",
"summary": "executes query by-example using a bitarray index",
"notes": "<br><br> This will find all documents matching a given example, using the specified skiplist index. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>index</em>: The id of the index to be used for the query. The index must exist and must be of type <em>bitarray</em>. <li><em>example</em>: an example document. The example must contain a value for each attribute in the index. <li><em>skip</em>: The number of documents to skip in the query. (optional) <li><em>limit</em>: The maximal number of documents to return. (optional) </ul> Returns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details. <br><br>",
"summary": " Bitarray index",
"httpMethod": "PUT",
"examples": "",
"nickname": "executesQueryBy-exampleUsingABitarrayIndex"
"nickname": "BitarrayIndex"
}
],
"path": "/_api/simple/by-example-bitarray"
@ -121,7 +121,7 @@
"code": "400"
},
{
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. The same error code is also returned if an invalid index id or type is used. <br><br>",
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. The same error code is also returned if an invalid index id or type is used. @endDocuBlock",
"code": "404"
}
],
@ -134,11 +134,11 @@
"description": "Contains the query specification. <br><br>"
}
],
"notes": "<br><br> This will find all documents matching a given condition, using the specified skiplist index. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>index</em>: The id of the index to be used for the query. The index must exist and must be of type <em>skiplist</em>. <li><em>condition</em>: the condition which all returned documents shall satisfy. Conditions must be specified for all indexed attributes. <li><em>skip</em>: The number of documents to skip in the query. (optional) <li><em>limit</em>: The maximal number of documents to return. (optional) </ul> Returns a cursor containing the result, see the manual for details. <br><br>",
"summary": "executes query by-condition using a skiplist index",
"notes": "<br><br> This will find all documents matching a given condition, using the specified skiplist index. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>index</em>: The id of the index to be used for the query. The index must exist and must be of type <em>skiplist</em>. <li><em>condition</em>: the condition which all returned documents shall satisfy. Conditions must be specified for all indexed attributes. <li><em>skip</em>: The number of documents to skip in the query. (optional) <li><em>limit</em>: The maximal number of documents to return. (optional) </ul> Returns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details. <br><br>",
"summary": "Query by-condition using Skiplist index",
"httpMethod": "PUT",
"examples": "",
"nickname": "executesQueryBy-conditionUsingASkiplistIndex"
"nickname": "QueryBy-conditionUsingSkiplistIndex"
}
],
"path": "/_api/simple/by-condition-skiplist"
@ -156,7 +156,7 @@
"code": "400"
},
{
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. The same error code is also returned if an invalid index id or type is used. <br><br>",
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. The same error code is also returned if an invalid index id or type is used. <br><br> @endDocuBlock",
"code": "404"
}
],
@ -169,11 +169,11 @@
"description": "Contains the query specification. <br><br>"
}
],
"notes": "<br><br> This will find all documents matching a given condition, using the specified skiplist index. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>index</em>: The id of the index to be used for the query. The index must exist and must be of type <em>bitarray</em>. <li><em>condition</em>: the condition which all returned documents shall satisfy. Conditions must be specified for all indexed attributes. <li><em>skip</em>: The number of documents to skip in the query. (optional) <li><em>limit</em>: The maximal number of documents to return. (optional) </ul> Returns a cursor containing the result, see the manual for details. <br><br>",
"summary": "executes query by-condition using a bitarray index",
"notes": "<br><br> This will find all documents matching a given condition, using the specified skiplist index. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>index</em>: The id of the index to be used for the query. The index must exist and must be of type <em>bitarray</em>. <li><em>condition</em>: the condition which all returned documents shall satisfy. Conditions must be specified for all indexed attributes. <li><em>skip</em>: The number of documents to skip in the query. (optional) <li><em>limit</em>: The maximal number of documents to return. (optional) </ul> Returns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details. <br><br>",
"summary": " Query by-condition using bitarray index",
"httpMethod": "PUT",
"examples": "",
"nickname": "executesQueryBy-conditionUsingABitarrayIndex"
"nickname": "QueryBy-conditionUsingBitarrayIndex"
}
],
"path": "/_api/simple/by-condition-bitarray"
@ -204,11 +204,11 @@
"description": "Contains the query. <br><br>"
}
],
"notes": "<br><br> Returns all documents of a collections. The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>skip</em>: The number of documents to skip in the query (optional). <li><em>limit</em>: The maximal amount of documents to return. The <em>skip</em> is applied before the <em>limit</em> restriction. (optional) </ul> Returns a cursor containing the result, see the manual for details. <br><br>",
"summary": "executes simple query ALL",
"notes": "<br><br> Returns all documents of a collections. The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>skip</em>: The number of documents to skip in the query (optional). <li><em>limit</em>: The maximal amount of documents to return. The <em>skip</em> is applied before the <em>limit</em> restriction. (optional) </ul> Returns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details. <br><br>",
"summary": " Return all",
"httpMethod": "PUT",
"examples": "<br><br> Limit the amount of documents using <em>limit</em> <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/all\n{ \"collection\": \"products\", \"skip\": 2, \"limit\" : 2 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/188694951\", \n \"_rev\" : \"188694951\", \n \"_key\" : \"188694951\", \n \"Hello2\" : \"World2\" \n }, \n { \n \"_id\" : \"products/188367271\", \n \"_rev\" : \"188367271\", \n \"_key\" : \"188367271\", \n \"Hello1\" : \"World1\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br><br><br> Using a <em>batchSize</em> value <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/all\n{ \"collection\": \"products\", \"batchSize\" : 3 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/190595495\", \n \"_rev\" : \"190595495\", \n \"_key\" : \"190595495\", \n \"Hello2\" : \"World2\" \n }, \n { \n \"_id\" : \"products/191578535\", \n \"_rev\" : \"191578535\", \n \"_key\" : \"191578535\", \n \"Hello5\" : \"World5\" \n }, \n { \n \"_id\" : \"products/190267815\", \n \"_rev\" : \"190267815\", \n \"_key\" : \"190267815\", \n \"Hello1\" : \"World1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"191775143\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"nickname": "executesSimpleQueryAll"
"examples": "<br><br> Limit the amount of documents using <em>limit</em> <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/all\n{ \"collection\": \"products\", \"skip\": 2, \"limit\" : 2 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/987504134\", \n \"_rev\" : \"987504134\", \n \"_key\" : \"987504134\", \n \"Hello1\" : \"World1\" \n }, \n { \n \"_id\" : \"products/988814854\", \n \"_rev\" : \"988814854\", \n \"_key\" : \"988814854\", \n \"Hello5\" : \"World5\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br> Using a <em>batchSize</em> value <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/all\n{ \"collection\": \"products\", \"batchSize\" : 3 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/990453254\", \n \"_rev\" : \"990453254\", \n \"_key\" : \"990453254\", \n \"Hello4\" : \"World4\" \n }, \n { \n \"_id\" : \"products/990125574\", \n \"_rev\" : \"990125574\", \n \"_key\" : \"990125574\", \n \"Hello3\" : \"World3\" \n }, \n { \n \"_id\" : \"products/989470214\", \n \"_rev\" : \"989470214\", \n \"_key\" : \"989470214\", \n \"Hello1\" : \"World1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"990977542\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "ReturnAll"
}
],
"path": "/_api/simple/all"
@ -240,10 +240,10 @@
}
],
"notes": "<br><br> Returns a random document from a collection. The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The identifier or name of the collection to query. </ul> Returns a JSON object with the document stored in the attribute <em>document</em> if the collection contains at least one document. If the collection is empty, the <em>document</em> attrbute contains null. <br><br>",
"summary": "returns a random document from a collection",
"summary": " Random document",
"httpMethod": "PUT",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/any\n{ \"collection\": \"products\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"document\" : { \n \"_id\" : \"products/192168359\", \n \"_rev\" : \"192168359\", \n \"_key\" : \"192168359\", \n \"Hello1\" : \"World1\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "returnsARandomDocumentFromACollection"
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/any\n{ \"collection\": \"products\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"document\" : { \n \"_id\" : \"products/992747014\", \n \"_rev\" : \"992747014\", \n \"_key\" : \"992747014\", \n \"Hello5\" : \"World5\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "RandomDocument"
}
],
"path": "/_api/simple/any"
@ -274,11 +274,11 @@
"description": "Contains the query. <br><br>"
}
],
"notes": "<br><br> The default will find at most 100 documents near the given coordinate. The returned list is sorted according to the distance, with the nearest document being first in the list. If there are near documents of equal distance, documents are chosen randomly from this set until the limit is reached. <br><br> In order to use the <em>near</em> operator, a geo index must be defined for the collection. This index also defines which attribute holds the coordinates for the document. If you have more then one geo-spatial index, you can use the <em>geo</em> field to select a particular index. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>latitude</em>: The latitude of the coordinate. <li><em>longitude</em>: The longitude of the coordinate. <li><em>distance</em>: If given, the attribute key used to return the distance to the given coordinate. (optional). If specified, distances are returned in meters. <li><em>skip</em>: The number of documents to skip in the query. (optional) <li><em>limit</em>: The maximal amount of documents to return. The <em>skip</em> is applied before the <em>limit</em> restriction. The default is 100. (optional) <li><em>geo</em>: If given, the identifier of the geo-index to use. (optional) </ul> Returns a cursor containing the result, see the manual for details. <br><br>",
"summary": "executes a near query",
"notes": "<br><br> The default will find at most 100 documents near the given coordinate. The returned list is sorted according to the distance, with the nearest document being first in the list. If there are near documents of equal distance, documents are chosen randomly from this set until the limit is reached. <br><br> In order to use the <em>near</em> operator, a geo index must be defined for the collection. This index also defines which attribute holds the coordinates for the document. If you have more then one geo-spatial index, you can use the <em>geo</em> field to select a particular index. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>latitude</em>: The latitude of the coordinate. <li><em>longitude</em>: The longitude of the coordinate. <li><em>distance</em>: If given, the attribute key used to return the distance to the given coordinate. (optional). If specified, distances are returned in meters. <li><em>skip</em>: The number of documents to skip in the query. (optional) <li><em>limit</em>: The maximal amount of documents to return. The <em>skip</em> is applied before the <em>limit</em> restriction. The default is 100. (optional) <li><em>geo</em>: If given, the identifier of the geo-index to use. (optional) </ul> Returns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details. <br><br>",
"summary": " Near query",
"httpMethod": "PUT",
"examples": "<br><br> Without distance: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/near\n{ \"collection\": \"products\", \"latitude\" : 0, \"longitude\" : 0, \"skip\" : 1, \"limit\" : 2 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/195445159\", \n \"_rev\" : \"195445159\", \n \"_key\" : \"195445159\", \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/195051943\", \n \"_rev\" : \"195051943\", \n \"_key\" : \"195051943\", \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br><br><br> With distance: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/near\n{ \"collection\": \"products\", \"latitude\" : 0, \"longitude\" : 0, \"skip\" : 1, \"limit\" : 3, \"distance\" : \"distance\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/197935527\", \n \"_rev\" : \"197935527\", \n \"_key\" : \"197935527\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/198328743\", \n \"_rev\" : \"198328743\", \n \"_key\" : \"198328743\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/197738919\", \n \"_rev\" : \"197738919\", \n \"_key\" : \"197738919\", \n \"distance\" : 444.779706578235, \n \"name\" : \"Name/-0.004/\", \n \"loc\" : [ \n -0.004, \n 0 \n ] \n } \n ], \n \"hasMore\" : false, \n \"count\" : 3, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"nickname": "executesANearQuery"
"examples": "<br><br> Without distance: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/near\n{ \"collection\": \"products\", \"latitude\" : 0, \"longitude\" : 0, \"skip\" : 1, \"limit\" : 2 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/994844166\", \n \"_rev\" : \"994844166\", \n \"_key\" : \"994844166\", \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/994450950\", \n \"_rev\" : \"994450950\", \n \"_key\" : \"994450950\", \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br> With distance: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/near\n{ \"collection\": \"products\", \"latitude\" : 0, \"longitude\" : 0, \"skip\" : 1, \"limit\" : 3, \"distance\" : \"distance\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/997465606\", \n \"_rev\" : \"997465606\", \n \"_key\" : \"997465606\", \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ], \n \"distance\" : 222.38985328911744 \n }, \n { \n \"_id\" : \"products/997858822\", \n \"_rev\" : \"997858822\", \n \"_key\" : \"997858822\", \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ], \n \"distance\" : 222.38985328911744 \n }, \n { \n \"_id\" : \"products/997268998\", \n \"_rev\" : \"997268998\", \n \"_key\" : \"997268998\", \n \"name\" : \"Name/-0.004/\", \n \"loc\" : [ \n -0.004, \n 0 \n ], \n \"distance\" : 444.779706578235 \n } \n ], \n \"hasMore\" : false, \n \"count\" : 3, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "NearQuery"
}
],
"path": "/_api/simple/near"
@ -309,11 +309,11 @@
"description": "Contains the query. <br><br>"
}
],
"notes": "<br><br> This will find all documents within a given radius around the coordinate (<em>latitude</em>, <em>longitude</em>). The returned list is sorted by distance. <br><br> In order to use the <em>within</em> operator, a geo index must be defined for the collection. This index also defines which attribute holds the coordinates for the document. If you have more then one geo-spatial index, you can use the <em>geo</em> field to select a particular index. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>latitude</em>: The latitude of the coordinate. <li><em>longitude</em>: The longitude of the coordinate. <li><em>radius</em>: The maximal radius (in meters). <li><em>distance</em>: If given, the attribute key used to return the distance to the given coordinate. (optional). If specified, distances are returned in meters. <li><em>skip</em>: The number of documents to skip in the query. (optional) <li><em>limit</em>: The maximal amount of documents to return. The <em>skip</em> is applied before the <em>limit</em> restriction. The default is 100. (optional) <li><em>geo</em>: If given, the identifier of the geo-index to use. (optional) </ul> Returns a cursor containing the result, see the manual for details. <br><br>",
"summary": "executes a within query",
"notes": "<br><br> This will find all documents within a given radius around the coordinate (<em>latitude</em>, <em>longitude</em>). The returned list is sorted by distance. <br><br> In order to use the <em>within</em> operator, a geo index must be defined for the collection. This index also defines which attribute holds the coordinates for the document. If you have more then one geo-spatial index, you can use the <em>geo</em> field to select a particular index. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>latitude</em>: The latitude of the coordinate. <li><em>longitude</em>: The longitude of the coordinate. <li><em>radius</em>: The maximal radius (in meters). <li><em>distance</em>: If given, the attribute key used to return the distance to the given coordinate. (optional). If specified, distances are returned in meters. <li><em>skip</em>: The number of documents to skip in the query. (optional) <li><em>limit</em>: The maximal amount of documents to return. The <em>skip</em> is applied before the <em>limit</em> restriction. The default is 100. (optional) <li><em>geo</em>: If given, the identifier of the geo-index to use. (optional) </ul> Returns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details. <br><br>",
"summary": " Within query",
"httpMethod": "PUT",
"examples": "<br><br> Without distance: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/near\n{ \"collection\": \"products\", \"latitude\" : 0, \"longitude\" : 0, \"skip\" : 1, \"limit\" : 2, \"radius\" : 500 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/201212327\", \n \"_rev\" : \"201212327\", \n \"_key\" : \"201212327\", \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/200819111\", \n \"_rev\" : \"200819111\", \n \"_key\" : \"200819111\", \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br><br><br> With distance: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/near\n{ \"collection\": \"products\", \"latitude\" : 0, \"longitude\" : 0, \"skip\" : 1, \"limit\" : 3, \"distance\" : \"distance\", \"radius\" : 300 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/203702695\", \n \"_rev\" : \"203702695\", \n \"_key\" : \"203702695\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/204095911\", \n \"_rev\" : \"204095911\", \n \"_key\" : \"204095911\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/203506087\", \n \"_rev\" : \"203506087\", \n \"_key\" : \"203506087\", \n \"distance\" : 444.779706578235, \n \"name\" : \"Name/-0.004/\", \n \"loc\" : [ \n -0.004, \n 0 \n ] \n } \n ], \n \"hasMore\" : false, \n \"count\" : 3, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"nickname": "executesAWithinQuery"
"examples": "<br><br> Without distance: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/near\n{ \"collection\": \"products\", \"latitude\" : 0, \"longitude\" : 0, \"skip\" : 1, \"limit\" : 2, \"radius\" : 500 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/1000873478\", \n \"_rev\" : \"1000873478\", \n \"_key\" : \"1000873478\", \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/1000480262\", \n \"_rev\" : \"1000480262\", \n \"_key\" : \"1000480262\", \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br> With distance: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/near\n{ \"collection\": \"products\", \"latitude\" : 0, \"longitude\" : 0, \"skip\" : 1, \"limit\" : 3, \"distance\" : \"distance\", \"radius\" : 300 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/1003494918\", \n \"_rev\" : \"1003494918\", \n \"_key\" : \"1003494918\", \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ], \n \"distance\" : 222.38985328911744 \n }, \n { \n \"_id\" : \"products/1004346886\", \n \"_rev\" : \"1004346886\", \n \"_key\" : \"1004346886\", \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ], \n \"distance\" : 222.38985328911744 \n }, \n { \n \"_id\" : \"products/1003298310\", \n \"_rev\" : \"1003298310\", \n \"_key\" : \"1003298310\", \n \"name\" : \"Name/-0.004/\", \n \"loc\" : [ \n -0.004, \n 0 \n ], \n \"distance\" : 444.779706578235 \n } \n ], \n \"hasMore\" : false, \n \"count\" : 3, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "WithinQuery"
}
],
"path": "/_api/simple/within"
@ -344,11 +344,11 @@
"description": "Contains the query. <br><br>"
}
],
"notes": "<br><br> This will find all documents from the collection that match the fulltext query specified in <em>query</em>. <br><br> In order to use the <em>fulltext</em> operator, a fulltext index must be defined for the collection and the specified attribute. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>attribute</em>: The attribute that contains the texts. <li><em>query</em>: The fulltext query. <li><em>skip</em>: The number of documents to skip in the query (optional). <li><em>limit</em>: The maximal amount of documents to return. The <em>skip</em> is applied before the <em>limit</em> restriction. (optional) <li><em>index</em>: The identifier of the fulltext-index to use. </ul> Returns a cursor containing the result, see the manual for details. <br><br>",
"summary": "executes a fulltext index query",
"notes": "<br><br> This will find all documents from the collection that match the fulltext query specified in <em>query</em>. <br><br> In order to use the <em>fulltext</em> operator, a fulltext index must be defined for the collection and the specified attribute. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>attribute</em>: The attribute that contains the texts. <li><em>query</em>: The fulltext query. <li><em>skip</em>: The number of documents to skip in the query (optional). <li><em>limit</em>: The maximal amount of documents to return. The <em>skip</em> is applied before the <em>limit</em> restriction. (optional) <li><em>index</em>: The identifier of the fulltext-index to use. </ul> Returns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details. <br><br>",
"summary": " Fulltext index query",
"httpMethod": "PUT",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/fulltext\n{ \"collection\": \"products\", \"attribute\" : \"text\", \"query\" : \"word\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/205734311\", \n \"_rev\" : \"205734311\", \n \"_key\" : \"205734311\", \n \"text\" : \"this text also has a word\" \n }, \n { \n \"_id\" : \"products/205537703\", \n \"_rev\" : \"205537703\", \n \"_key\" : \"205537703\", \n \"text\" : \"this text contains word\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"nickname": "executesAFulltextIndexQuery"
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/fulltext\n{ \"collection\": \"products\", \"attribute\" : \"text\", \"query\" : \"word\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/1009196550\", \n \"_rev\" : \"1009196550\", \n \"_key\" : \"1009196550\", \n \"text\" : \"this text also has a word\" \n }, \n { \n \"_id\" : \"products/1008999942\", \n \"_rev\" : \"1008999942\", \n \"_key\" : \"1008999942\", \n \"text\" : \"this text contains word\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "FulltextIndexQuery"
}
],
"path": "/_api/simple/fulltext"
@ -379,11 +379,11 @@
"description": "Contains the query. <br><br>"
}
],
"notes": "<br><br> This will find all documents matching a given example. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>example</em>: The example document. <li><em>skip</em>: The number of documents to skip in the query (optional). <li><em>limit</em>: The maximal amount of documents to return. The <em>skip</em> is applied before the <em>limit</em> restriction. (optional) </ul> Returns a cursor containing the result, see the manual for details. <br><br>",
"summary": "executes simple query by-example",
"notes": "<br><br> This will find all documents matching a given example. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>example</em>: The example document. <li><em>skip</em>: The number of documents to skip in the query (optional). <li><em>limit</em>: The maximal amount of documents to return. The <em>skip</em> is applied before the <em>limit</em> restriction. (optional) </ul> Returns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details. <br><br>",
"summary": " Simple query by-example",
"httpMethod": "PUT",
"examples": "<br><br> Matching an attribute: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/by-example\n{ \"collection\": \"products\", \"example\" : { \"i\" : 1 } }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/207307175\", \n \"_rev\" : \"207307175\", \n \"_key\" : \"207307175\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/207765927\", \n \"_rev\" : \"207765927\", \n \"_key\" : \"207765927\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 2, \n \"j\" : 2 \n } \n }, \n { \n \"_id\" : \"products/206979495\", \n \"_rev\" : \"206979495\", \n \"_key\" : \"206979495\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/207569319\", \n \"_rev\" : \"207569319\", \n \"_key\" : \"207569319\", \n \"i\" : 1 \n } \n ], \n \"hasMore\" : false, \n \"count\" : 4, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br><br><br> Matching an attribute which is a sub-document: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/by-example\n{ \"collection\": \"products\", \"example\" : { \"a.j\" : 1 } }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/209273255\", \n \"_rev\" : \"209273255\", \n \"_key\" : \"209273255\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/208945575\", \n \"_rev\" : \"208945575\", \n \"_key\" : \"208945575\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br><br><br> Matching an attribute within a sub-document: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } } }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/211239335\", \n \"_rev\" : \"211239335\", \n \"_key\" : \"211239335\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n } \n ], \n \"hasMore\" : false, \n \"count\" : 1, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"nickname": "executesSimpleQueryBy-example"
"examples": "<br><br> Matching an attribute: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/by-example\n{ \"collection\": \"products\", \"example\" : { \"i\" : 1 } }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/1010900486\", \n \"_rev\" : \"1010900486\", \n \"_key\" : \"1010900486\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/1011162630\", \n \"_rev\" : \"1011162630\", \n \"_key\" : \"1011162630\", \n \"i\" : 1 \n }, \n { \n \"_id\" : \"products/1011359238\", \n \"_rev\" : \"1011359238\", \n \"_key\" : \"1011359238\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 2, \n \"j\" : 2 \n } \n }, \n { \n \"_id\" : \"products/1010572806\", \n \"_rev\" : \"1010572806\", \n \"_key\" : \"1010572806\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n } \n ], \n \"hasMore\" : false, \n \"count\" : 4, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br> Matching an attribute which is a sub-document: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/by-example\n{ \"collection\": \"products\", \"example\" : { \"a.j\" : 1 } }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/1012604422\", \n \"_rev\" : \"1012604422\", \n \"_key\" : \"1012604422\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/1012932102\", \n \"_rev\" : \"1012932102\", \n \"_key\" : \"1012932102\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br> Matching an attribute within a sub-document: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } } }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/1014963718\", \n \"_rev\" : \"1014963718\", \n \"_key\" : \"1014963718\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n } \n ], \n \"hasMore\" : false, \n \"count\" : 1, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "SimpleQueryBy-example"
}
],
"path": "/_api/simple/by-example"
@ -415,10 +415,10 @@
}
],
"notes": "<br><br> This will return the first document matching a given example. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>example</em>: The example document. </ul> Returns a result containing the document or <em>HTTP 404</em> if no document matched the example. <br><br> If more than one document in the collection matches the specified example, only one of these documents will be returned, and it is undefined which of the matching documents is returned. <br><br>",
"summary": "returns a document matching an example",
"summary": " Document matching an example",
"httpMethod": "PUT",
"examples": "<br><br> If a matching document was found: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/first-example\n{ \"collection\": \"products\", \"example\" : { \"i\" : 1 } }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"document\" : { \n \"_id\" : \"products/212877735\", \n \"_rev\" : \"212877735\", \n \"_key\" : \"212877735\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br> If no document was found: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/first-example\n{ \"collection\": \"products\", \"example\" : { \"l\" : 1 } }\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 404, \n \"errorMessage\" : \"no match\" \n}\n\n</code></pre><br>",
"nickname": "returnsADocumentMatchingAnExample"
"examples": "<br><br> If a matching document was found: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/first-example\n{ \"collection\": \"products\", \"example\" : { \"i\" : 1 } }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"document\" : { \n \"_id\" : \"products/1017257478\", \n \"_rev\" : \"1017257478\", \n \"_key\" : \"1017257478\", \n \"i\" : 1 \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br> If no document was found: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/first-example\n{ \"collection\": \"products\", \"example\" : { \"l\" : 1 } }\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 404, \n \"errorMessage\" : \"no match\" \n}\n</code></pre><br>@endDocuBlock",
"nickname": "DocumentMatchingAnExample"
}
],
"path": "/_api/simple/first-example"
@ -450,10 +450,10 @@
}
],
"notes": "<br><br> This will return the first document(s) from the collection, in the order of insertion/update time. When the <em>count</em> argument is supplied, the result will be a list of documents, with the \"oldest\" document being first in the result list. If the <em>count</em> argument is not supplied, the result is the \"oldest\" document of the collection, or <em>null</em> if the collection is empty. <br><br> The request body must be a JSON object with the following attributes: <ul class=\"swagger-list\"><li><em>collection</em>: the name of the collection <li><em>count</em>: the number of documents to return at most. Specifiying count is optional. If it is not specified, it defaults to 1. </ul> Note: this method is not supported for sharded collections with more than one shard. <br><br>",
"summary": "returns the first document(s) of a collection",
"summary": " First document of a collection",
"httpMethod": "PUT",
"examples": "<br><br> Retrieving the first n documents: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/first\n{ \"collection\": \"products\", \"count\" : 2 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/216678823\", \n \"_rev\" : \"216678823\", \n \"_key\" : \"216678823\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/217006503\", \n \"_rev\" : \"217006503\", \n \"_key\" : \"217006503\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br> Retrieving the first document: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/first\n{ \"collection\": \"products\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"_id\" : \"products/218251687\", \n \"_rev\" : \"218251687\", \n \"_key\" : \"218251687\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "returnsTheFirstDocument(s)OfACollection"
"examples": "<br><br> Retrieving the first n documents: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/first\n{ \"collection\": \"products\", \"count\" : 2 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/1020599814\", \n \"_rev\" : \"1020599814\", \n \"_key\" : \"1020599814\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/1020927494\", \n \"_rev\" : \"1020927494\", \n \"_key\" : \"1020927494\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br> Retrieving the first document: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/first\n{ \"collection\": \"products\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"_id\" : \"products/1022238214\", \n \"_rev\" : \"1022238214\", \n \"_key\" : \"1022238214\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "FirstDocumentOfACollection"
}
],
"path": "/_api/simple/first"
@ -485,10 +485,10 @@
}
],
"notes": "<br><br> This will return the last documents from the collection, in the order of insertion/update time. When the <em>count</em> argument is supplied, the result will be a list of documents, with the \"latest\" document being first in the result list. <br><br> The request body must be a JSON object with the following attributes: <ul class=\"swagger-list\"><li><em>collection</em>: the name of the collection <li><em>count</em>: the number of documents to return at most. Specifiying count is optional. If it is not specified, it defaults to 1. </ul> If the <em>count</em> argument is not supplied, the result is the \"latest\" document of the collection, or <em>null</em> if the collection is empty. <br><br> Note: this method is not supported for sharded collections with more than one shard. <br><br>",
"summary": "returns the last document(s) of a collection",
"summary": " Last document of a collection",
"httpMethod": "PUT",
"examples": "<br><br> Retrieving the last n documents: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/last\n{ \"collection\": \"products\", \"count\" : 2 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/220610983\", \n \"_rev\" : \"220610983\", \n \"_key\" : \"220610983\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 2, \n \"j\" : 2 \n } \n }, \n { \n \"_id\" : \"products/220414375\", \n \"_rev\" : \"220414375\", \n \"_key\" : \"220414375\", \n \"i\" : 1 \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br> Retrieving the first document: <br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/last\n{ \"collection\": \"products\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"_id\" : \"products/222183847\", \n \"_rev\" : \"222183847\", \n \"_key\" : \"222183847\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 2, \n \"j\" : 2 \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "returnsTheLastDocument(s)OfACollection"
"examples": "<br><br> Retrieving the last n documents: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/last\n{ \"collection\": \"products\", \"count\" : 2 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/1024663046\", \n \"_rev\" : \"1024663046\", \n \"_key\" : \"1024663046\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 2, \n \"j\" : 2 \n } \n }, \n { \n \"_id\" : \"products/1024466438\", \n \"_rev\" : \"1024466438\", \n \"_key\" : \"1024466438\", \n \"i\" : 1 \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br> Retrieving the first document: <br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/last\n{ \"collection\": \"products\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"_id\" : \"products/1026301446\", \n \"_rev\" : \"1026301446\", \n \"_key\" : \"1026301446\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 2, \n \"j\" : 2 \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "LastDocumentOfACollection"
}
],
"path": "/_api/simple/last"
@ -519,11 +519,11 @@
"description": "Contains the query. <br><br>"
}
],
"notes": "<br><br> This will find all documents within a given range. In order to execute a range query, a skip-list index on the queried attribute must be present. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>attribute</em>: The attribute path to check. <li><em>left</em>: The lower bound. <li><em>right</em>: The upper bound. <li><em>closed</em>: If <em>true</em>, use interval including <em>left</em> and <em>right</em>, otherwise exclude <em>right</em>, but include <em>left</em>. <li><em>skip</em>: The number of documents to skip in the query (optional). <li><em>limit</em>: The maximal amount of documents to return. The <em>skip</em> is applied before the <em>limit</em> restriction. (optional) </ul> Returns a cursor containing the result, see the manual for details. <br><br>",
"summary": "executes simple range query",
"notes": "<br><br> This will find all documents within a given range. In order to execute a range query, a skip-list index on the queried attribute must be present. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to query. <li><em>attribute</em>: The attribute path to check. <li><em>left</em>: The lower bound. <li><em>right</em>: The upper bound. <li><em>closed</em>: If <em>true</em>, use interval including <em>left</em> and <em>right</em>, otherwise exclude <em>right</em>, but include <em>left</em>. <li><em>skip</em>: The number of documents to skip in the query (optional). <li><em>limit</em>: The maximal amount of documents to return. The <em>skip</em> is applied before the <em>limit</em> restriction. (optional) </ul> Returns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details. <br><br>",
"summary": " Simple range query",
"httpMethod": "PUT",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/range\n{ \"collection\": \"products\", \"attribute\" : \"i\", \"left\" : 2, \"right\" : 4 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/223035815\", \n \"_rev\" : \"223035815\", \n \"_key\" : \"223035815\", \n \"i\" : 2 \n }, \n { \n \"_id\" : \"products/223232423\", \n \"_rev\" : \"223232423\", \n \"_key\" : \"223232423\", \n \"i\" : 3 \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
"nickname": "executesSimpleRangeQuery"
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/range\n{ \"collection\": \"products\", \"attribute\" : \"i\", \"left\" : 2, \"right\" : 4 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/1027284486\", \n \"_rev\" : \"1027284486\", \n \"_key\" : \"1027284486\", \n \"i\" : 2 \n }, \n { \n \"_id\" : \"products/1027481094\", \n \"_rev\" : \"1027481094\", \n \"_key\" : \"1027481094\", \n \"i\" : 3 \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "SimpleRangeQuery"
}
],
"path": "/_api/simple/range"
@ -555,10 +555,10 @@
}
],
"notes": "<br><br> This will find all documents in the collection that match the specified example object. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to remove from. <li><em>example</em>: An example document that all collection documents are compared against. <li>options: an json object which can contains following attributes: <li><em>waitForSync</em>: if set to true, then all removal operations will instantly be synchronised to disk. If this is not specified, then the collection's default sync behavior will be applied. <li><em>limit</em>: an optional value that determines how many documents to delete at most. If <em>limit</em> is specified but is less than the number of documents in the collection, it is undefined which of the documents will be deleted. </ul> Note: the <em>limit</em> attribute is not supported on sharded collections. Using it will result in an error. The options attributes waitForSync and limit can given yet without an ecapsulation into a json object. but this may be deprecated in future versions of arango <br><br> Returns the number of documents that were deleted. <br><br>",
"summary": "removes documents by example",
"summary": " Remove documents by example",
"httpMethod": "PUT",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/remove-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } } }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Using Parameter: waitForSync and limit<br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/remove-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } },\"waitForSync\": true, \"limit\": 2 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Using Parameter: waitForSync and limit with new signature<br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/remove-by-example\n{\"collection\": \"products\",\"example\" : { \"a\" : { \"j\" : 1 } },\"options\": {\"waitForSync\": true, \"limit\": 2} }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "removesDocumentsByExample"
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/remove-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } } }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>Using Parameter: waitForSync and limit<br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/remove-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } },\"waitForSync\": true, \"limit\": 2 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>Using Parameter: waitForSync and limit with new signature<br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/remove-by-example\n{\"collection\": \"products\",\"example\" : { \"a\" : { \"j\" : 1 } },\"options\": {\"waitForSync\": true, \"limit\": 2} }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "RemoveDocumentsByExample"
}
],
"path": "/_api/simple/remove-by-example"
@ -590,10 +590,10 @@
}
],
"notes": "<br><br> This will find all documents in the collection that match the specified example object, and replace the entire document body with the new value specified. Note that document meta-attributes such as <em>_id</em>, <em>_key</em>, <em>_from</em>, <em>_to</em> etc. cannot be replaced. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to replace within. <li><em>example</em>: An example document that all collection documents are compared against. <li><em>newValue</em>: The replacement document that will get inserted in place of the \"old\" documents. <li><em>options</em>: an json object which can contain following attributes <li><em>waitForSync</em>: if set to true, then all removal operations will instantly be synchronised to disk. If this is not specified, then the collection's default sync behavior will be applied. <li><em>limit</em>: an optional value that determines how many documents to replace at most. If <em>limit</em> is specified but is less than the number of documents in the collection, it is undefined which of the documents will be replaced. </ul> Note: the <em>limit</em> attribute is not supported on sharded collections. Using it will result in an error. The options attributes waitForSync and limit can given yet without an ecapsulation into a json object. but this may be deprecated in future versions of arango <br><br> Returns the number of documents that were replaced. <br><br>",
"summary": "replaces documents by example",
"summary": " Replace documents by example",
"httpMethod": "PUT",
"examples": "<br><br><br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/replace-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } }, \"newValue\" : {\"foo\" : \"bar\"}, \"options\": {\"limit\" : 3, \"waitForSync\": true }}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"replaced\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Using new Signature for attributes WaitForSync and limit<br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/replace-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } }, \"newValue\" : {\"foo\" : \"bar\"}, \"options\": {\"limit\" : 3, \"waitForSync\": true }}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"replaced\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "replacesDocumentsByExample"
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/replace-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } }, \"newValue\" : {\"foo\" : \"bar\"}, \"limit\" : 3 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"replaced\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>Using new Signature for attributes WaitForSync and limit<br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/replace-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } }, \"newValue\" : {\"foo\" : \"bar\"}, \"options\": {\"limit\" : 3, \"waitForSync\": true }}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"replaced\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "ReplaceDocumentsByExample"
}
],
"path": "/_api/simple/replace-by-example"
@ -625,10 +625,10 @@
}
],
"notes": "<br><br> This will find all documents in the collection that match the specified example object, and partially update the document body with the new value specified. Note that document meta-attributes such as <em>_id</em>, <em>_key</em>, <em>_from</em>, <em>_to</em> etc. cannot be replaced. <br><br> The call expects a JSON object as body with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>collection</em>: The name of the collection to update within. <li><em>example</em>: An example document that all collection documents are compared against. <li><em>newValue</em>: A document containing all the attributes to update in the found documents. <li><em>options</em>: a json object wich can contains following attributes: <li><em>keepNull</em>: This parameter can be used to modify the behavior when handling <em>null</em> values. Normally, <em>null</em> values are stored in the database. By setting the <em>keepNull</em> parameter to <em>false</em>, this behavior can be changed so that all attributes in <em>data</em> with <em>null</em> values will be removed from the updated document. <li><em>waitForSync</em>: if set to true, then all removal operations will instantly be synchronised to disk. If this is not specified, then the collection's default sync behavior will be applied. <li><em>limit</em>: an optional value that determines how many documents to update at most. If <em>limit</em> is specified but is less than the number of documents in the collection, it is undefined which of the documents will be updated. </ul> Note: the <em>limit</em> attribute is not supported on sharded collections. Using it will result in an error. <br><br> Returns the number of documents that were updated. <br><br> <br><br>",
"summary": "updates documents by example",
"summary": " Update documents by example",
"httpMethod": "PUT",
"examples": "using old syntax for options<br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/update-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } }, \"newValue\" : { \"a\" : { \"j\" : 22 } }, \"limit\" : 3 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"updated\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>using new signature for options<br><br><pre><code class=\"json\">unix> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/update-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } }, \"newValue\" : { \"a\" : { \"j\" : 22 } }, \"options\" : { \"limit\" : 3, \"waitForSync\": true } }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"updated\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "updatesDocumentsByExample"
"examples": "using old syntax for options<br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/update-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } }, \"newValue\" : { \"a\" : { \"j\" : 22 } }, \"limit\" : 3 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"updated\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>using new signature for options<br><br><pre><code class=\"json\">shell> curl -X PUT --data-binary @- --dump - http://localhost:8529/_api/simple/update-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } }, \"newValue\" : { \"a\" : { \"j\" : 22 } }, \"options\" : { \"limit\" : 3, \"waitForSync\": true } }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"updated\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br>@endDocuBlock",
"nickname": "UpdateDocumentsByExample"
}
],
"path": "/_api/simple/update-by-example"

File diff suppressed because one or more lines are too long

View File

@ -33,11 +33,11 @@
"description": "Contains the <em>collections</em> and <em>action</em>. <br><br>"
}
],
"notes": "<br><br> The transaction description must be passed in the body of the POST request. <br><br> The following attributes must be specified inside the JSON object: <br><br> <ul class=\"swagger-list\"><li><em>collections</em>: contains the list of collections to be used in the transaction (mandatory). <em>collections</em> must be a JSON array that can have the optional sub-attributes <em>read</em> and <em>write</em>. <em>read</em> and <em>write</em> must each be either lists of collections names or strings with a single collection name. <li><em>action</em>: the actual transaction operations to be executed, in the form of stringified Javascript code. The code will be executed on server side, with late binding. It is thus critical that the code specified in <em>action</em> properly sets up all the variables it needs. If the code specified in <em>action</em> ends with a return statement, the value returned will also be returned by the REST API in the <em>result</em> attribute if the transaction committed successfully. </ul> The following optional attributes may also be specified in the request: <br><br> <ul class=\"swagger-list\"><li><em>waitForSync</em>: an optional boolean flag that, if set, will force the transaction to write all data to disk before returning. <li><em>lockTimeout</em>: an optional numeric value that can be used to set a timeout for waiting on collection locks. If not specified, a default value will be used. Setting <em>lockTimeout</em> to <em>0</em> will make ArangoDB not time out waiting for a lock. <li><em>replicate</em>: whether or not to replicate the operations from this transaction. If not specified, the default value is <em>true</em>. <li><em>params</em>: optional arguments passed to <em>action</em>. </ul> If the transaction is fully executed and committed on the server, <em>HTTP 200</em> will be returned. Additionally, the return value of the code defined in <em>action</em> will be returned in the <em>result</em> attribute. <br><br> For successfully committed transactions, the returned JSON object has the following properties: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate if an error occurred (<em>false</em> in this case) <li><em>code</em>: the HTTP status code <li><em>result</em>: the return value of the transaction </ul> If the transaction specification is either missing or malformed, the server will respond with <em>HTTP 400</em>. <br><br> The body of the response will then contain a JSON object with additional error details. The object has the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case) <li><em>code</em>: the HTTP status code <li><em>errorNum</em>: the server error number <li><em>errorMessage</em>: a descriptive error message </ul> If a transaction fails to commit, either by an exception thrown in the <em>action</em> code, or by an internal error, the server will respond with an error. Any other errors will be returned with any of the return codes <em>HTTP 400</em>, <em>HTTP 409</em>, or <em>HTTP 500</em>. <br><br>",
"summary": "executes a transaction",
"notes": "<br><br> The transaction description must be passed in the body of the POST request. <br><br> The following attributes must be specified inside the JSON object: <br><br> <ul class=\"swagger-list\"><li><em>collections</em>: contains the list of collections to be used in the transaction (mandatory). <em>collections</em> must be a JSON array that can have the optional sub-attributes <em>read</em> and <em>write</em>. <em>read</em> and <em>write</em> must each be either lists of collections names or strings with a single collection name. <li><em>action</em>: the actual transaction operations to be executed, in the form of stringified Javascript code. The code will be executed on server side, with late binding. It is thus critical that the code specified in <em>action</em> properly sets up all the variables it needs. If the code specified in <em>action</em> ends with a return statement, the value returned will also be returned by the REST API in the <em>result</em> attribute if the transaction committed successfully. </ul> The following optional attributes may also be specified in the request: <br><br> <ul class=\"swagger-list\"><li><em>waitForSync</em>: an optional boolean flag that, if set, will force the transaction to write all data to disk before returning. <li><em>lockTimeout</em>: an optional numeric value that can be used to set a timeout for waiting on collection locks. If not specified, a default value will be used. Setting <em>lockTimeout</em> to <em>0</em> will make ArangoDB not time out waiting for a lock. <li><em>params</em>: optional arguments passed to <em>action</em>. </ul> If the transaction is fully executed and committed on the server, <em>HTTP 200</em> will be returned. Additionally, the return value of the code defined in <em>action</em> will be returned in the <em>result</em> attribute. <br><br> For successfully committed transactions, the returned JSON object has the following properties: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate if an error occurred (<em>false</em> in this case) <li><em>code</em>: the HTTP status code <li><em>result</em>: the return value of the transaction </ul> If the transaction specification is either missing or malformed, the server will respond with <em>HTTP 400</em>. <br><br> The body of the response will then contain a JSON object with additional error details. The object has the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case) <li><em>code</em>: the HTTP status code <li><em>errorNum</em>: the server error number <li><em>errorMessage</em>: a descriptive error message </ul> If a transaction fails to commit, either by an exception thrown in the <em>action</em> code, or by an internal error, the server will respond with an error. Any other errors will be returned with any of the return codes <em>HTTP 400</em>, <em>HTTP 409</em>, or <em>HTTP 500</em>. <br><br>",
"summary": " Execute transaction",
"httpMethod": "POST",
"examples": "<br><br> Executing a transaction on a single collection: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/transaction\n{\"collections\":{\"write\":\"products\"},\"action\":\"function () { var db = require('internal').db; db.products.save({}); return db.products.count(); }\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br> Executing a transaction using multiple collections: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/transaction\n{\"collections\":{\"write\":[\"products\",\"materials\"]},\"action\":\"function () { var db = require('internal').db; db.products.save({}); db.materials.save({}); return 'worked!'; }\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : \"worked!\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br> Aborting a transaction due to an internal error: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/transaction\n{\"collections\":{\"write\":\"products\"},\"action\":\"function () { var db = require('internal').db; db.products.save({ _key: 'abc'}); db.products.save({ _key: 'abc'}); }\"}\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1210, \n \"errorMessage\" : \"unique constraint violated\" \n}\n\n</code></pre><br><br><br> Aborting a transaction by explicitly throwing an exception: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/transaction\n{\"collections\":{\"read\":\"products\"},\"action\":\"function () { throw 'doh!'; }\"}\n\nHTTP/1.1 500 Internal Error\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 500, \n \"errorNum\" : 500, \n \"errorMessage\" : \"doh!\" \n}\n\n</code></pre><br><br><br> Referring to a non-existing collection: <br><br><br><br><pre><code class=\"json\">unix> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/transaction\n{\"collections\":{\"read\":\"products\"},\"action\":\"function () { return true; }\"}\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 1203, \n \"errorMessage\" : \"collection not found\" \n}\n\n</code></pre><br>",
"nickname": "executesATransaction"
"examples": "<br><br> Executing a transaction on a single collection: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/transaction\n{ \n \"collections\" : { \n \"write\" : \"products\" \n }, \n \"action\" : \"function () { var db = require('internal').db; db.products.save({}); return db.products.count(); }\" \n}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br> Executing a transaction using multiple collections: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/transaction\n{ \n \"collections\" : { \n \"write\" : [ \n \"products\", \n \"materials\" \n ] \n }, \n \"action\" : \"function () { var db = require('internal').db; db.products.save({}); db.materials.save({}); return 'worked!'; }\" \n}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : \"worked!\", \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br> Aborting a transaction due to an internal error: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/transaction\n{ \n \"collections\" : { \n \"write\" : \"products\" \n }, \n \"action\" : \"function () { var db = require('internal').db; db.products.save({ _key: 'abc'}); db.products.save({ _key: 'abc'}); }\" \n}\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1210, \n \"errorMessage\" : \"unique constraint violated\" \n}\n</code></pre><br><br><br> Aborting a transaction by explicitly throwing an exception: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/transaction\n{ \n \"collections\" : { \n \"read\" : \"products\" \n }, \n \"action\" : \"function () { throw 'doh!'; }\" \n}\n\nHTTP/1.1 500 Internal Error\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 500, \n \"errorNum\" : 500, \n \"errorMessage\" : \"doh!\" \n}\n</code></pre><br><br><br> Referring to a non-existing collection: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/transaction\n{ \n \"collections\" : { \n \"read\" : \"products\" \n }, \n \"action\" : \"function () { return true; }\" \n}\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 1203, \n \"errorMessage\" : \"collection not found\" \n}\n</code></pre><br>@endDocuBlock",
"nickname": "ExecuteTransaction"
}
],
"path": "/_api/transaction"

File diff suppressed because one or more lines are too long

View File

@ -8,28 +8,43 @@
{
"errorResponses": [
{
"reason": "returned if the user can be added by the server. <br><br>",
"reason": "The user was found <br><br>",
"code": "200"
},
{
"reason": "The user with user does not exist <br><br> @endDocuBlock",
"code": "404"
}
],
"parameters": [],
"notes": "<br><br> Fetches data about the specified user. <br><br> The call will return a JSON document with at least the following attributes on success: <br><br> <em> *user</em>: The name of the user as a string. <em> *active</em>: An optional flag that specifies whether the user is active. <em> *extra</em>: An optional JSON object with arbitrary extra data about the user. <em> *changePassword</em>: An optional flag that specifies whether the user must change the password or not. <br><br>",
"summary": " Fetch User",
"httpMethod": "GET",
"examples": "",
"nickname": "FetchUser"
}
],
"path": "/_api/user/{user}"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "Returned if the user can be added by the server <br><br>",
"code": "201"
},
{
"reason": "If the JSON representation is malformed or mandatory data is missing from the request. <br><br>",
"reason": "If the JSON representation is malformed or mandatory data is missing from the request. <br><br> @endDocuBlock",
"code": "400"
}
],
"parameters": [
{
"dataType": "Json",
"paramType": "body",
"required": "true",
"name": "body",
"description": "<br><br>"
}
],
"notes": "<br><br> The following data need to be passed in a JSON representation in the body of the POST request: <br><br> <ul class=\"swagger-list\"><li><em>user</em>: The name of the user as a string. This is mandatory. <li><em>passwd</em>: The user password as a string. If no password is specified, the empty string will be used. <li><em>active</em>: an optional flag that specifies whether the user is active. If not specified, this will default to <em>true</em>. <li><em>extra</em>: an optional JSON object with arbitrary extra data about the user. <li><em>changePassword</em>: an optional flag that specifies whethers the user must change the password or not. If not specified, this will default to <em>false</em>. If set to <em>true</em>, the only operations allowed are <em>PUT /_api/user</em> or <em>PATCH /_api/user</em>. All other operations will result in a <em>HTTP 403</em>. </ul> If the user can be added by the server, the server will respond with <em>HTTP 201</em>. <br><br> In case of success, the returned JSON object has the following properties: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>false</em> in this case) <li><em>code</em>: the HTTP status code </ul> If the JSON representation is malformed or mandatory data is missing from the request, the server will respond with <em>HTTP 400</em>. <br><br> The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case) <li><em>code</em>: the HTTP status code <li><em>errorNum</em>: the server error number <li><em>errorMessage</em>: a descriptive error message",
"summary": "creates user",
"parameters": [],
"notes": "<br><br> The following data need to be passed in a JSON representation in the body of the POST request: <br><br> <em> *user</em>: The name of the user as a string. This is mandatory <em> *passwd</em>: The user password as a string. If no password is specified, the empty string will be used <em> *active</em>: An optional flag that specifies whether the user is active. If not specified, this will default to true <em> *extra</em>: An optional JSON object with arbitrary extra data about the user <em> *changePassword</em>: An optional flag that specifies whethers the user must change the password or not. If not specified, this will default to false <br><br> If set to true, the only operations allowed are PUT /_api/user or PATCH /_api/user. All other operations will result in a HTTP 403. If the user can be added by the server, the server will respond with HTTP 201. In case of success, the returned JSON object has the following properties: <br><br> <em> *error</em>: Boolean flag to indicate that an error occurred (false in this case) <em> *code</em>: The HTTP status code <br><br> If the JSON representation is malformed or mandatory data is missing from the request, the server will respond with HTTP 400. <br><br> The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br> <em> *error</em>: Boolean flag to indicate that an error occurred (true in this case) <em> *code</em>: The HTTP status code <em> *errorNum</em>: The server error number <em> *errorMessage</em>: A descriptive error message <br><br>",
"summary": " Create User",
"httpMethod": "POST",
"examples": "",
"nickname": "createsUser"
"nickname": "CreateUser"
}
],
"path": "/_api/user"
@ -39,39 +54,24 @@
{
"errorResponses": [
{
"reason": "Is returned if the user data can be replaced by the server. <br><br>",
"reason": "Is returned if the user data can be replaced by the server <br><br>",
"code": "200"
},
{
"reason": "The JSON representation is malformed or mandatory data is missing from the request. <br><br>",
"reason": "The JSON representation is malformed or mandatory data is missing from the request <br><br>",
"code": "400"
},
{
"reason": "The specified user does not exist. <br><br>",
"reason": "The specified user does not exist <br><br> @endDocuBlock",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "user",
"description": "The name of the user. <br><br>"
},
{
"dataType": "Json",
"paramType": "body",
"required": "true",
"name": "body",
"description": "<br><br>"
}
],
"notes": "<br><br> Replaces the data of an existing user. The name of an existing user must be specified in <em>user</em>. <br><br> The following data can to be passed in a JSON representation in the body of the POST request: <br><br> <ul class=\"swagger-list\"><li><em>passwd</em>: The user password as a string. Specifying a password is mandatory, but the empty string is allowed for passwords. <li><em>active</em>: an optional flag that specifies whether the user is active. If not specified, this will default to <em>true</em>. <li><em>extra</em>: an optional JSON object with arbitrary extra data about the user. <li><em>changePassword</em>: an optional flag that specifies whether the user must change the password or not. If not specified, this will default to <em>false</em>. </ul> If the user can be replaced by the server, the server will respond with `HTTP 200`. <br><br> In case of success, the returned JSON object has the following properties: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>false</em> in this case) <li><em>code</em>: the HTTP status code </ul> If the JSON representation is malformed or mandatory data is missing from the request, the server will respond with <em>HTTP 400</em>. If the specified user does not exist, the server will respond with <em>HTTP 404</em>. <br><br> The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case) <li><em>code</em>: the HTTP status code <li><em>errorNum</em>: the server error number <li><em>errorMessage</em>: a descriptive error message",
"summary": "replaces user",
"parameters": [],
"notes": "<br><br> Replaces the data of an existing user. The name of an existing user must be specified in user. <br><br> The following data can to be passed in a JSON representation in the body of the POST request: <br><br> <em> *passwd</em>: The user password as a string. Specifying a password is mandatory, but the empty string is allowed for passwords <em> *active</em>: An optional flag that specifies whether the user is active. If not specified, this will default to true <em> *extra</em>: An optional JSON object with arbitrary extra data about the user <em> *changePassword</em>: An optional flag that specifies whether the user must change the password or not. If not specified, this will default to false <br><br> If the user can be replaced by the server, the server will respond with HTTP 200. <br><br> In case of success, the returned JSON object has the following properties: <br><br> <em> *error</em>: Boolean flag to indicate that an error occurred (false in this case) <em> *code</em>: The HTTP status code <br><br> If the JSON representation is malformed or mandatory data is missing from the request, the server will respond with HTTP 400. If the specified user does not exist, the server will respond with HTTP 404. <br><br> The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br> <em> *error</em>: Boolean flag to indicate that an error occurred (true in this case) <em> *code</em>: The HTTP status code <em> *errorNum</em>: The server error number <em> *errorMessage</em>: A descriptive error message <br><br>",
"summary": " Replace User",
"httpMethod": "PUT",
"examples": "",
"nickname": "replacesUser"
"nickname": "ReplaceUser"
}
],
"path": "/_api/user/{user}"
@ -81,39 +81,24 @@
{
"errorResponses": [
{
"reason": "Is returned if the user data can be replaced by the server. <br><br>",
"reason": "Is returned if the user data can be replaced by the server <br><br>",
"code": "200"
},
{
"reason": "The JSON representation is malformed or mandatory data is missing from the request. <br><br>",
"reason": "The JSON representation is malformed or mandatory data is missing from the request <br><br>",
"code": "400"
},
{
"reason": "The specified user does not exist. <br><br>",
"reason": "The specified user does not exist <br><br> @endDocuBlock",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "user",
"description": "The name of the user. <br><br>"
},
{
"dataType": "Json",
"paramType": "body",
"required": "true",
"name": "body",
"description": "<br><br>"
}
],
"notes": "<br><br> Partially updates the data of an existing user. The name of an existing user must be specified in <em>user</em>. <br><br> The following data can be passed in a JSON representation in the body of the POST request: <br><br> <ul class=\"swagger-list\"><li><em>passwd</em>: The user password as a string. Specifying a password is optional. If not specified, the previously existing value will not be modified. <li><em>active</em>: an optional flag that specifies whether the user is active. If not specified, the previously existing value will not be modified. <li><em>extra</em>: an optional JSON object with arbitrary extra data about the user. If not specified, the previously existing value will not be modified. <li><em>changePassword</em>: an optional flag that specifies whether the user must change the password or not. If not specified, the previously existing value will not be modified. </ul> If the user can be updated by the server, the server will respond with `HTTP 200`. <br><br> In case of success, the returned JSON object has the following properties: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>false</em> in this case) <li><em>code</em>: the HTTP status code </ul> If the JSON representation is malformed or mandatory data is missing from the request, the server will respond with <em>HTTP 400</em>. If the specified user does not exist, the server will respond with <em>HTTP 404</em>. <br><br> The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case) <li><em>code</em>: the HTTP status code <li><em>errorNum</em>: the server error number <li><em>errorMessage</em>: a descriptive error message",
"summary": "updates user",
"parameters": [],
"notes": "<br><br> Partially updates the data of an existing user. The name of an existing user must be specified in user. <br><br> The following data can be passed in a JSON representation in the body of the POST request: <br><br> <em> *passwd</em>: The user password as a string. Specifying a password is optional. If not specified, the previously existing value will not be modified. <em> *active</em>: An optional flag that specifies whether the user is active. If not specified, the previously existing value will not be modified. <em> *extra</em>: An optional JSON object with arbitrary extra data about the user. If not specified, the previously existing value will not be modified. <em> *changePassword</em>: An optional flag that specifies whether the user must change the password or not. If not specified, the previously existing value will not be modified. <br><br> If the user can be updated by the server, the server will respond with HTTP 200. <br><br> In case of success, the returned JSON object has the following properties: <br><br> <em> *error</em>: Boolean flag to indicate that an error occurred (false in this case) <em> *code</em>: The HTTP status code <br><br> If the JSON representation is malformed or mandatory data is missing from the request, the server will respond with HTTP 400. If the specified user does not exist, the server will respond with HTTP 404. <br><br> The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br> <em> *error</em>: Boolean flag to indicate that an error occurred (true in this case) <em> *code</em>: The HTTP status code <em> *errorNum</em>: The server error number <em> *errorMessage</em>: A descriptive error message <br><br>",
"summary": " Update User",
"httpMethod": "PATCH",
"examples": "",
"nickname": "updatesUser"
"nickname": "UpdateUser"
}
],
"path": "/_api/user/{user}"
@ -123,59 +108,20 @@
{
"errorResponses": [
{
"reason": "Is returned if the user was removed by the server. <br><br>",
"reason": "Is returned if the user was removed by the server <br><br>",
"code": "202"
},
{
"reason": "The specified user does not exist. <br><br>",
"reason": "The specified user does not exist <br><br> @endDocuBlock",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "user",
"description": "The name of the user. <br><br>"
}
],
"notes": "<br><br> Removes an existing user, identified by <em>user</em>. <br><br> If the user can be removed, the server will respond with <em>HTTP 202</em>. <br><br> In case of success, the returned JSON object has the following properties: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>false</em> in this case) <li><em>code</em>: the HTTP status code </ul> If the specified user does not exist, the server will respond with <em>HTTP 404</em>. <br><br> The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case) <li><em>code</em>: the HTTP status code <li><em>errorNum</em>: the server error number <li><em>errorMessage</em>: a descriptive error message",
"summary": "removes a user",
"parameters": [],
"notes": "<br><br> Removes an existing user, identified by user. <br><br> If the user can be removed, the server will respond with HTTP 202. In case of success, the returned JSON object has the following properties: <br><br> <em> *error</em>: Boolean flag to indicate that an error occurred (false in this case) <em> *code</em>: The HTTP status code <br><br> If the specified user does not exist, the server will respond with HTTP 404. <br><br> The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br> <em> *error</em>: Boolean flag to indicate that an error occurred (true in this case) <em> *code</em>: The HTTP status code <em> *errorNum</em>: The server error number <em> *errorMessage</em>: A descriptive error message <br><br>",
"summary": " Remove User",
"httpMethod": "DELETE",
"examples": "",
"nickname": "removesAUser"
}
],
"path": "/_api/user/{user}"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "The user was found. <br><br>",
"code": "200"
},
{
"reason": "The user with <em>user</em> does not exist. <br><br>",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "user",
"description": "The name of the user. <br><br>"
}
],
"notes": "<br><br> Fetches data about the specified user. <br><br> The call will return a JSON document with at least the following attributes on success: <br><br> <ul class=\"swagger-list\"><li><em>user</em>: The name of the user as a string. <li><em>active</em>: an optional flag that specifies whether the user is active. <li><em>extra</em>: an optional JSON object with arbitrary extra data about the user. <li><em>changePassword</em>: an optional flag that specifies whether the user must change the password or not.",
"summary": "fetches a user",
"httpMethod": "GET",
"examples": "",
"nickname": "fetchesAUser"
"nickname": "RemoveUser"
}
],
"path": "/_api/user/{user}"

View File

@ -21,11 +21,11 @@
"description": "If set to <em>true</em>, the response will contain a <em>details</em> attribute with additional information about included components and their versions. The attribute names and internals of the <em>details</em> object may vary depending on platform and ArangoDB version. <br><br>"
}
],
"notes": "Returns the server name and version number. The response is a JSON object with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>server</em>: will always contain <em>arango</em> <li><em>version</em>: the server version string. The string has the format \"<em>major</em>.`minor<em>.`sub</em>\". <em>major</em> and <em>minor</em> will be numeric, and <em>sub</em> may contain a number or a textual version. <li><em>details</em>: an optional JSON object with additional details. This is returned only if the <em>details</em> URL parameter is set to <em>true</em> in the request.",
"summary": "returns the server version",
"notes": "Returns the server name and version number. The response is a JSON object with the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>server</em>: will always contain <em>arango</em> <li><em>version</em>: the server version string. The string has the format \"<em>major</em>.*minor<em>.*sub</em>\". <em>major</em> and <em>minor</em> will be numeric, and <em>sub</em> may contain a number or a textual version. <li><em>details</em>: an optional JSON object with additional details. This is returned only if the <em>details</em> URL parameter is set to <em>true</em> in the request.",
"summary": " Return server version",
"httpMethod": "GET",
"examples": "<br><br> Returns the version information. <br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/version\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"server\" : \"arango\", \n \"version\" : \"2.1.0-devel\" \n}\n\n</code></pre><br><br><br> Returns the version information with details. <br><br><br><br><pre><code class=\"json\">unix> curl --dump - http://localhost:8529/_api/version?details=true\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"server\" : \"arango\", \n \"version\" : \"2.1.0-devel\", \n \"details\" : { \n \"build-date\" : \"Jun 6 2014 15:25:47\", \n \"configure\" : \"'./configure' '--enable-all-in-one-icu'\", \n \"icu-version\" : \"49.1.2\", \n \"libev-version\" : \"4.11\", \n \"openssl-version\" : \"OpenSSL 0.9.8y 5 Feb 2013\", \n \"repository-version\" : \"heads/devel-0-gf5bbf94b043745ab45c9fe14bc8429b502bcfa3d-dirty\", \n \"server-version\" : \"2.1.0-devel\", \n \"sizeof int\" : \"4\", \n \"sizeof void*\" : \"8\", \n \"v8-version\" : \"3.16.14\" \n } \n}\n\n</code></pre><br>",
"nickname": "returnsTheServerVersion"
"examples": "<br><br> Returns the version information. <br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/version\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"server\" : \"arango\", \n \"version\" : \"2.2.2-rc1\" \n}\n</code></pre><br><br><br> Returns the version information with details. <br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/version?details=true\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"server\" : \"arango\", \n \"version\" : \"2.2.2-rc1\", \n \"details\" : { \n \"build-date\" : \"Aug 6 2014 16:32:54\", \n \"configure\" : \"'./configure' '--enable-all-in-one-icu' '--enable-relative' '--enable-maintainer-mode'\", \n \"icu-version\" : \"52.1\", \n \"libev-version\" : \"4.11\", \n \"openssl-version\" : \"OpenSSL 0.9.8y 5 Feb 2013\", \n \"repository-version\" : \"tags/v2.2.2-rc1-0-gb8df91e175fba53212b464304531234b7559636b\", \n \"server-version\" : \"2.2.2-rc1\", \n \"sizeof int\" : \"4\", \n \"sizeof void*\" : \"8\", \n \"v8-version\" : \"3.16.14\" \n } \n}\n</code></pre><br>@endDocuBlock",
"nickname": "ReturnServerVersion"
}
],
"path": "/_api/version"

View File

@ -25,7 +25,7 @@
this._retryCount = 0;
},
failureTry: function(retry, err) {
failureTry: function(retry, ignore, err) {
if (err.status === 401) {
window.App.requestAuth();
} else {

View File

@ -151,7 +151,7 @@ function AttributesSuite () {
////////////////////////////////////////////////////////////////////////////////
testReservedAttributes : function () {
var doc = { "_id" : "foo", "_rev": "99", "_key" : "meow", "_from" : "33", "_to": "99", "_test" : false };
var doc = { "_id" : "foo", "_rev": "99", "_key" : "meow", "_from" : "33", "_to": "99", "_test" : false, "_boom" : "bang" };
var d1 = c.save(doc);
var d2 = c.document(d1._id);
@ -161,17 +161,33 @@ function AttributesSuite () {
assertEqual(cn + "/meow", d1._id);
assertEqual(cn + "/meow", d2._id);
assertEqual(d1._rev, d2._rev);
assertFalse(d2._test);
assertEqual("bang", d2._boom);
assertFalse(d2.hasOwnProperty("_from"));
assertFalse(d2.hasOwnProperty("_to"));
// user specified _rev value must have been ignored
assertTrue(d1._rev !== "99");
// test attributes
var i;
for (i in d2) {
if (d2.hasOwnProperty(i)) {
assertTrue(i !== "_from" && i !== "_to" && i !== "_test");
}
}
},
////////////////////////////////////////////////////////////////////////////////
/// @brief reserved attribute names
////////////////////////////////////////////////////////////////////////////////
testEmbeddedReservedAttributes : function () {
var doc = { "_id" : "foo", "_rev": "99", "_key" : "meow", "_from" : "33", "_to": "99", "_test" : false };
c.save({ _key: "mydoc", _embedded: doc });
var d = c.document("mydoc");
assertEqual(cn + "/mydoc", d._id);
assertEqual("mydoc", d._key);
assertEqual("foo", d._embedded._id);
assertEqual("99", d._embedded._rev);
assertEqual("meow", d._embedded._key);
assertEqual("33", d._embedded._from);
assertEqual("99", d._embedded._to);
assertFalse(d._embedded._test);
},
////////////////////////////////////////////////////////////////////////////////

View File

@ -44,7 +44,7 @@
// --SECTION-- forward declarations
// -----------------------------------------------------------------------------
static bool FillShapeValueJson (TRI_shaper_t* shaper, TRI_shape_value_t* dst, TRI_json_t const* json, bool, bool);
static bool FillShapeValueJson (TRI_shaper_t* shaper, TRI_shape_value_t* dst, TRI_json_t const* json, size_t, bool, bool);
static TRI_json_t* JsonShapeData (TRI_shaper_t* shaper, TRI_shape_t const* shape, char const* data, uint64_t size);
static bool StringifyJsonShapeData (TRI_shaper_t* shaper, TRI_string_buffer_t* buffer, TRI_shape_t const* shape, char const* data, uint64_t size);
@ -470,6 +470,7 @@ static bool FillShapeValueString (TRI_shaper_t* shaper, TRI_shape_value_t* dst,
static bool FillShapeValueList (TRI_shaper_t* shaper,
TRI_shape_value_t* dst,
TRI_json_t const* json,
size_t level,
bool create,
bool isLocked) {
size_t i, n;
@ -506,7 +507,7 @@ static bool FillShapeValueList (TRI_shaper_t* shaper,
dst->_size = sizeof(TRI_shape_length_list_t);
dst->_value = (ptr = static_cast<char*>(TRI_Allocate(shaper->_memoryZone, dst->_size, false)));
if (dst->_value == NULL) {
if (dst->_value == nullptr) {
return false;
}
@ -518,7 +519,7 @@ static bool FillShapeValueList (TRI_shaper_t* shaper,
// convert into TRI_shape_value_t array
p = (values = static_cast<TRI_shape_value_t*>(TRI_Allocate(shaper->_memoryZone, sizeof(TRI_shape_value_t) * n, true)));
if (p == NULL) {
if (p == nullptr) {
return false;
}
@ -526,12 +527,12 @@ static bool FillShapeValueList (TRI_shaper_t* shaper,
e = values + n;
for (i = 0; i < n; ++i, ++p) {
TRI_json_t const* el = (TRI_json_t const*) TRI_AtVector(&json->_value._objects, i);
bool ok = FillShapeValueJson(shaper, p, el, create, isLocked);
TRI_json_t const* el = static_cast<TRI_json_t const*>(TRI_AtVector(&json->_value._objects, i));
bool ok = FillShapeValueJson(shaper, p, el, level + 1, create, isLocked);
if (! ok) {
for (e = p, p = values; p < e; ++p) {
if (p->_value != NULL) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -774,6 +775,7 @@ static bool FillShapeValueList (TRI_shaper_t* shaper,
static bool FillShapeValueArray (TRI_shaper_t* shaper,
TRI_shape_value_t* dst,
TRI_json_t const* json,
size_t level,
bool create,
bool isLocked) {
size_t i, n;
@ -808,7 +810,7 @@ static bool FillShapeValueArray (TRI_shaper_t* shaper,
// convert into TRI_shape_value_t array
p = (values = static_cast<TRI_shape_value_t*>(TRI_Allocate(shaper->_memoryZone, n * sizeof(TRI_shape_value_t), true)));
if (p == NULL) {
if (p == nullptr) {
return false;
}
@ -817,36 +819,49 @@ static bool FillShapeValueArray (TRI_shaper_t* shaper,
v = 0;
for (i = 0; i < n; ++i, ++p) {
bool ok;
TRI_json_t const* key = static_cast<TRI_json_t const*>(TRI_AtVector(&json->_value._objects, 2 * i));
TRI_ASSERT(key != nullptr);
TRI_json_t* key = static_cast<TRI_json_t*>(TRI_AtVector(&json->_value._objects, 2 * i));
TRI_json_t* val = static_cast<TRI_json_t*>(TRI_AtVector(&json->_value._objects, 2 * i + 1));
char const* k = key->_value._string.data;
TRI_ASSERT(key != NULL);
TRI_ASSERT(val != NULL);
if (key->_value._string.data == NULL ||
key->_value._string.length == 1 ||
key->_value._string.data[0] == '_') {
// empty or reserved attribute name
if (k == nullptr ||
key->_value._string.length == 1) {
// empty attribute name
p--;
continue;
}
if (*k == '_' && level == 0) {
// on top level, strip reserved attributes before shaping
if (strcmp(k, "_key") == 0 ||
strcmp(k, "_rev") == 0 ||
strcmp(k, "_id") == 0 ||
strcmp(k, "_from") == 0 ||
strcmp(k, "_to") == 0) {
// found a reserved attribute - discard it
--p;
continue;
}
}
// first find an identifier for the name
p->_aid = shaper->findOrCreateAttributeByName(shaper, key->_value._string.data);
p->_aid = shaper->findOrCreateAttributeByName(shaper, k);
// convert value
bool ok;
if (p->_aid == 0) {
ok = false;
}
else {
ok = FillShapeValueJson(shaper, p, val, create, isLocked);
TRI_json_t const* val = static_cast<TRI_json_t const*>(TRI_AtVector(&json->_value._objects, 2 * i + 1));
TRI_ASSERT(val != nullptr);
ok = FillShapeValueJson(shaper, p, val, level + 1, create, isLocked);
}
if (! ok) {
for (e = p, p = values; p < e; ++p) {
if (p->_value != NULL) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -893,13 +908,13 @@ static bool FillShapeValueArray (TRI_shaper_t* shaper,
+ n * sizeof(TRI_shape_aid_t)
+ (f + 1) * sizeof(TRI_shape_size_t);
a = (TRI_array_shape_t*) (ptr = static_cast<char*>(TRI_Allocate(shaper->_memoryZone, i, true)));
a = reinterpret_cast<TRI_array_shape_t*>(ptr = static_cast<char*>(TRI_Allocate(shaper->_memoryZone, i, true)));
if (ptr == NULL) {
if (ptr == nullptr) {
e = values + n;
for (p = values; p < e; ++p) {
if (p->_value != NULL) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -937,11 +952,11 @@ static bool FillShapeValueArray (TRI_shaper_t* shaper,
dst->_size = total;
dst->_value = (ptr = static_cast<char*>(TRI_Allocate(shaper->_memoryZone, dst->_size, true)));
if (ptr == NULL) {
if (ptr == nullptr) {
e = values + n;
for (p = values; p < e; ++p) {
if (p->_value != NULL) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -982,7 +997,7 @@ static bool FillShapeValueArray (TRI_shaper_t* shaper,
// free TRI_shape_value_t array
for (p = values; p < e; ++p) {
if (p->_value != NULL) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -992,7 +1007,7 @@ static bool FillShapeValueArray (TRI_shaper_t* shaper,
// lookup this shape
found = shaper->findShape(shaper, &a->base, create);
if (found == NULL) {
if (found == nullptr) {
TRI_Free(shaper->_memoryZone, a);
return false;
}
@ -1009,6 +1024,7 @@ static bool FillShapeValueArray (TRI_shaper_t* shaper,
static bool FillShapeValueJson (TRI_shaper_t* shaper,
TRI_shape_value_t* dst,
TRI_json_t const* json,
size_t level,
bool create,
bool isLocked) {
switch (json->_type) {
@ -1029,10 +1045,10 @@ static bool FillShapeValueJson (TRI_shaper_t* shaper,
return FillShapeValueString(shaper, dst, json);
case TRI_JSON_ARRAY:
return FillShapeValueArray(shaper, dst, json, create, isLocked);
return FillShapeValueArray(shaper, dst, json, level, create, isLocked);
case TRI_JSON_LIST:
return FillShapeValueList(shaper, dst, json, create, isLocked);
return FillShapeValueList(shaper, dst, json, level, create, isLocked);
}
return false;
@ -1143,8 +1159,8 @@ static TRI_json_t* JsonShapeDataArray (TRI_shaper_t* shaper,
// create an array with the appropriate size
array = TRI_CreateArray2Json(shaper->_memoryZone, (size_t) n);
if (array == NULL) {
return NULL;
if (array == nullptr) {
return nullptr;
}
qtr = (char const*) shape;
@ -1159,7 +1175,7 @@ static TRI_json_t* JsonShapeDataArray (TRI_shaper_t* shaper,
offsetsF = (TRI_shape_size_t const*) qtr;
shapeCache._sid = 0;
shapeCache._shape = NULL;
shapeCache._shape = nullptr;
for (i = 0; i < f; ++i, ++sids, ++aids, ++offsetsF) {
TRI_shape_sid_t sid = *sids;
@ -1180,21 +1196,21 @@ static TRI_json_t* JsonShapeDataArray (TRI_shaper_t* shaper,
shapeCache._sid = sid;
}
if (subshape == NULL) {
if (subshape == nullptr) {
LOG_WARNING("cannot find shape #%u", (unsigned int) sid);
continue;
}
name = shaper->lookupAttributeId(shaper, aid);
if (name == NULL) {
if (name == nullptr) {
LOG_WARNING("cannot find attribute #%u", (unsigned int) aid);
continue;
}
element = JsonShapeData(shaper, subshape, data + offset, offsetsF[1] - offset);
if (element == NULL) {
if (element == nullptr) {
LOG_WARNING("cannot decode element for shape #%u", (unsigned int) sid);
continue;
}
@ -1224,21 +1240,21 @@ static TRI_json_t* JsonShapeDataArray (TRI_shaper_t* shaper,
shapeCache._sid = sid;
}
if (subshape == NULL) {
if (subshape == nullptr) {
LOG_WARNING("cannot find shape #%u", (unsigned int) sid);
continue;
}
name = shaper->lookupAttributeId(shaper, aid);
if (name == NULL) {
if (name == nullptr) {
LOG_WARNING("cannot find attribute #%u", (unsigned int) aid);
continue;
}
element = JsonShapeData(shaper, subshape, data + offset, offsetsV[1] - offset);
if (element == NULL) {
if (element == nullptr) {
LOG_WARNING("cannot decode element for shape #%u", (unsigned int) sid);
continue;
}
@ -1250,7 +1266,7 @@ static TRI_json_t* JsonShapeDataArray (TRI_shaper_t* shaper,
if (shaper->_memoryZone->_failed) {
TRI_FreeJson(shaper->_memoryZone, array);
return NULL;
return nullptr;
}
return array;
@ -1265,7 +1281,6 @@ static TRI_json_t* JsonShapeDataList (TRI_shaper_t* shaper,
char const* data,
uint64_t size) {
char const* ptr;
TRI_json_t* list;
TRI_shape_sid_t const* sids;
TRI_shape_size_t const* offsets;
TRI_shape_length_list_t l;
@ -1276,10 +1291,10 @@ static TRI_json_t* JsonShapeDataList (TRI_shaper_t* shaper,
l = * (TRI_shape_length_list_t const*) ptr;
// create a list with the appropriate size
list = TRI_CreateList2Json(shaper->_memoryZone, (size_t) l);
TRI_json_t* list = TRI_CreateList2Json(shaper->_memoryZone, (size_t) l);
if (list == NULL) {
return NULL;
if (list == nullptr) {
return nullptr;
}
ptr += sizeof(TRI_shape_length_list_t);
@ -1289,7 +1304,7 @@ static TRI_json_t* JsonShapeDataList (TRI_shaper_t* shaper,
offsets = (TRI_shape_size_t const*) ptr;
shapeCache._sid = 0;
shapeCache._shape = NULL;
shapeCache._shape = nullptr;
for (i = 0; i < l; ++i, ++sids, ++offsets) {
TRI_shape_sid_t sid = *sids;
@ -1308,14 +1323,14 @@ static TRI_json_t* JsonShapeDataList (TRI_shaper_t* shaper,
shapeCache._sid = sid;
}
if (subshape == NULL) {
if (subshape == nullptr) {
LOG_WARNING("cannot find shape #%u", (unsigned int) sid);
continue;
}
element = JsonShapeData(shaper, subshape, data + offset, offsets[1] - offset);
if (element == NULL) {
if (element == nullptr) {
LOG_WARNING("cannot decode element for shape #%u", (unsigned int) sid);
continue;
}
@ -1327,7 +1342,7 @@ static TRI_json_t* JsonShapeDataList (TRI_shaper_t* shaper,
if (shaper->_memoryZone->_failed) {
TRI_FreeJson(shaper->_memoryZone, list);
return NULL;
return nullptr;
}
return list;
@ -1342,33 +1357,31 @@ static TRI_json_t* JsonShapeDataHomogeneousList (TRI_shaper_t* shaper,
char const* data,
uint64_t size) {
TRI_homogeneous_list_shape_t const* s;
TRI_json_t* list;
TRI_shape_length_list_t i;
TRI_shape_length_list_t l;
TRI_shape_sid_t sid;
TRI_shape_size_t const* offsets;
TRI_shape_t const* subshape;
char const* ptr;
s = (TRI_homogeneous_list_shape_t const*) shape;
sid = s->_sidEntry;
subshape = shaper->lookupShapeId(shaper, sid);
TRI_shape_t const* subshape = shaper->lookupShapeId(shaper, sid);
if (subshape == NULL) {
if (subshape == nullptr) {
LOG_WARNING("cannot find shape #%u", (unsigned int) sid);
return NULL;
return nullptr;
}
ptr = data;
l = * (TRI_shape_length_list_t const*) ptr;
// create a list with the appropriate size
list = TRI_CreateList2Json(shaper->_memoryZone, (size_t) l);
TRI_json_t* list = TRI_CreateList2Json(shaper->_memoryZone, (size_t) l);
if (list == NULL) {
return NULL;
if (list == nullptr) {
return nullptr;
}
ptr += sizeof(TRI_shape_length_list_t);
@ -1382,7 +1395,7 @@ static TRI_json_t* JsonShapeDataHomogeneousList (TRI_shaper_t* shaper,
element = JsonShapeData(shaper, subshape, data + offset, offsets[1] - offset);
if (element == NULL) {
if (element == nullptr) {
LOG_WARNING("cannot decode element for shape #%u", (unsigned int) sid);
continue;
}
@ -1394,7 +1407,7 @@ static TRI_json_t* JsonShapeDataHomogeneousList (TRI_shaper_t* shaper,
if (shaper->_memoryZone->_failed) {
TRI_FreeJson(shaper->_memoryZone, list);
return NULL;
return nullptr;
}
return list;
@ -1409,34 +1422,32 @@ static TRI_json_t* JsonShapeDataHomogeneousSizedList (TRI_shaper_t* shaper,
char const* data,
uint64_t size) {
TRI_homogeneous_sized_list_shape_t const* s;
TRI_json_t* list;
TRI_shape_length_list_t i;
TRI_shape_length_list_t l;
TRI_shape_sid_t sid;
TRI_shape_size_t length;
TRI_shape_size_t offset;
TRI_shape_t const* subshape;
char const* ptr;
s = (TRI_homogeneous_sized_list_shape_t const*) shape;
sid = s->_sidEntry;
subshape = shaper->lookupShapeId(shaper, sid);
TRI_shape_t const* subshape = shaper->lookupShapeId(shaper, sid);
if (subshape == NULL) {
if (subshape == nullptr) {
LOG_WARNING("cannot find shape #%u", (unsigned int) sid);
return NULL;
return nullptr;
}
ptr = data;
l = * (TRI_shape_length_list_t const*) ptr;
// create a list with the appropriate size
list = TRI_CreateList2Json(shaper->_memoryZone, (size_t) l);
TRI_json_t* list = TRI_CreateList2Json(shaper->_memoryZone, (size_t) l);
if (list == NULL) {
return NULL;
if (list == nullptr) {
return nullptr;
}
length = s->_sizeEntry;
@ -1447,7 +1458,7 @@ static TRI_json_t* JsonShapeDataHomogeneousSizedList (TRI_shaper_t* shaper,
element = JsonShapeData(shaper, subshape, data + offset, length);
if (element == NULL) {
if (element == nullptr) {
LOG_WARNING("cannot decode element for shape #%u", (unsigned int) sid);
continue;
}
@ -1467,8 +1478,8 @@ static TRI_json_t* JsonShapeData (TRI_shaper_t* shaper,
TRI_shape_t const* shape,
char const* data,
uint64_t size) {
if (shape == NULL) {
return NULL;
if (shape == nullptr) {
return nullptr;
}
switch (shape->_type) {
@ -2226,13 +2237,12 @@ TRI_shaped_json_t* TRI_ShapedJsonJson (TRI_shaper_t* shaper,
bool create,
bool isLocked) {
TRI_shape_value_t dst;
bool ok;
dst._value = 0;
ok = FillShapeValueJson(shaper, &dst, json, create, isLocked);
bool ok = FillShapeValueJson(shaper, &dst, json, 0, create, isLocked);
if (! ok) {
return NULL;
return nullptr;
}
#ifdef DEBUG_JSON_SHAPER
@ -2244,9 +2254,9 @@ TRI_shaped_json_t* TRI_ShapedJsonJson (TRI_shaper_t* shaper,
// no need to prefill shaped with 0's as all attributes are set directly afterwards
TRI_shaped_json_t* shaped = static_cast<TRI_shaped_json_t*>(TRI_Allocate(shaper->_memoryZone, sizeof(TRI_shaped_json_t), false));
if (shaped == NULL) {
if (shaped == nullptr) {
TRI_Free(shaper->_memoryZone, dst._value);
return NULL;
return nullptr;
}
shaped->_sid = dst._sid;

View File

@ -51,6 +51,7 @@ using namespace triagens::basics;
static int FillShapeValueJson (TRI_shaper_t* shaper,
TRI_shape_value_t* dst,
v8::Handle<v8::Value> const json,
size_t level,
set<int>& seenHashes,
vector< v8::Handle<v8::Object> >& seenObjects,
bool create);
@ -261,6 +262,7 @@ static int FillShapeValueString (TRI_shaper_t* shaper,
static int FillShapeValueList (TRI_shaper_t* shaper,
TRI_shape_value_t* dst,
v8::Handle<v8::Array> const json,
size_t level,
set<int>& seenHashes,
vector< v8::Handle<v8::Object> >& seenObjects,
bool create) {
@ -292,9 +294,9 @@ static int FillShapeValueList (TRI_shaper_t* shaper,
dst->_fixedSized = false;
dst->_size = sizeof(TRI_shape_length_list_t);
dst->_value = (ptr = (char*) TRI_Allocate(shaper->_memoryZone, dst->_size, false));
dst->_value = (ptr = static_cast<char*>(TRI_Allocate(shaper->_memoryZone, dst->_size, false)));
if (dst->_value == 0) {
if (dst->_value == nullptr) {
return TRI_ERROR_OUT_OF_MEMORY;
}
@ -304,9 +306,9 @@ static int FillShapeValueList (TRI_shaper_t* shaper,
}
// convert into TRI_shape_value_t array
p = (values = (TRI_shape_value_t*) TRI_Allocate(shaper->_memoryZone, sizeof(TRI_shape_value_t) * n, true));
p = (values = static_cast<TRI_shape_value_t*>(TRI_Allocate(shaper->_memoryZone, sizeof(TRI_shape_value_t) * n, true)));
if (p == 0) {
if (p == nullptr) {
return TRI_ERROR_OUT_OF_MEMORY;
}
@ -315,11 +317,11 @@ static int FillShapeValueList (TRI_shaper_t* shaper,
for (uint32_t i = 0; i < n; ++i, ++p) {
v8::Handle<v8::Value> el = json->Get(i);
int res = FillShapeValueJson(shaper, p, el, seenHashes, seenObjects, create);
int res = FillShapeValueJson(shaper, p, el, level + 1, seenHashes, seenObjects, create);
if (res != TRI_ERROR_NO_ERROR) {
for (e = p, p = values; p < e; ++p) {
if (p->_value != 0) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -356,9 +358,9 @@ static int FillShapeValueList (TRI_shaper_t* shaper,
shape = (TRI_homogeneous_sized_list_shape_t*) TRI_Allocate(shaper->_memoryZone, sizeof(TRI_homogeneous_sized_list_shape_t), true);
if (shape == 0) {
if (shape == nullptr) {
for (p = values; p < e; ++p) {
if (p->_value != 0) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -375,9 +377,9 @@ static int FillShapeValueList (TRI_shaper_t* shaper,
found = shaper->findShape(shaper, &shape->base, create);
if (found == 0) {
if (found == nullptr) {
for (p = values; p < e; ++p) {
if (p->_value != 0) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -394,18 +396,18 @@ static int FillShapeValueList (TRI_shaper_t* shaper,
return TRI_ERROR_INTERNAL;
}
TRI_ASSERT(found != 0);
TRI_ASSERT(found != nullptr);
dst->_type = found->_type;
dst->_sid = found->_sid;
dst->_fixedSized = false;
dst->_size = sizeof(TRI_shape_length_list_t) + total;
dst->_value = (ptr = (char*) TRI_Allocate(shaper->_memoryZone, dst->_size, false));
dst->_value = (ptr = static_cast<char*>(TRI_Allocate(shaper->_memoryZone, dst->_size, false)));
if (dst->_value == NULL) {
for (p = values; p < e; ++p) {
if (p->_value != 0) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -431,9 +433,9 @@ static int FillShapeValueList (TRI_shaper_t* shaper,
shape = (TRI_homogeneous_list_shape_t*) TRI_Allocate(shaper->_memoryZone, sizeof(TRI_homogeneous_list_shape_t), true);
if (shape == NULL) {
if (shape == nullptr) {
for (p = values; p < e; ++p) {
if (p->_value != 0) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -451,9 +453,9 @@ static int FillShapeValueList (TRI_shaper_t* shaper,
// if found returns non-NULL, it will free the shape!!
found = shaper->findShape(shaper, &shape->base, create);
if (found == 0) {
if (found == nullptr) {
for (p = values; p < e; ++p) {
if (p->_value != 0) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -470,7 +472,7 @@ static int FillShapeValueList (TRI_shaper_t* shaper,
return TRI_ERROR_INTERNAL;
}
TRI_ASSERT(found != 0);
TRI_ASSERT(found != nullptr);
dst->_type = found->_type;
dst->_sid = found->_sid;
@ -479,11 +481,11 @@ static int FillShapeValueList (TRI_shaper_t* shaper,
dst->_fixedSized = false;
dst->_size = offset + total;
dst->_value = (ptr = (char*) TRI_Allocate(shaper->_memoryZone, dst->_size, true));
dst->_value = (ptr = static_cast<char*>(TRI_Allocate(shaper->_memoryZone, dst->_size, true)));
if (dst->_value == 0) {
if (dst->_value == nullptr) {
for (p = values; p < e; ++p) {
if (p->_value != 0) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -525,9 +527,9 @@ static int FillShapeValueList (TRI_shaper_t* shaper,
dst->_size = offset + total;
dst->_value = (ptr = (char*) TRI_Allocate(shaper->_memoryZone, dst->_size, true));
if (dst->_value == NULL) {
if (dst->_value == nullptr) {
for (p = values; p < e; ++p) {
if (p->_value != 0) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -561,7 +563,7 @@ static int FillShapeValueList (TRI_shaper_t* shaper,
// free TRI_shape_value_t array
for (p = values; p < e; ++p) {
if (p->_value != 0) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -577,14 +579,10 @@ static int FillShapeValueList (TRI_shaper_t* shaper,
static int FillShapeValueArray (TRI_shaper_t* shaper,
TRI_shape_value_t* dst,
v8::Handle<v8::Object> const json,
size_t level,
set<int>& seenHashes,
vector< v8::Handle<v8::Object> >& seenObjects,
bool create) {
size_t total;
size_t f;
size_t v;
TRI_shape_value_t* values;
TRI_shape_value_t* p;
TRI_shape_value_t* e;
@ -606,19 +604,19 @@ static int FillShapeValueArray (TRI_shaper_t* shaper,
uint32_t n = names->Length();
// convert into TRI_shape_value_t array
p = (values = (TRI_shape_value_t*) TRI_Allocate(shaper->_memoryZone, n * sizeof(TRI_shape_value_t), true));
p = (values = static_cast<TRI_shape_value_t*>(TRI_Allocate(shaper->_memoryZone, n * sizeof(TRI_shape_value_t), true)));
if (p == 0) {
if (p == nullptr) {
return TRI_ERROR_OUT_OF_MEMORY;
}
size_t total = 0;
total = 0;
f = 0;
v = 0;
size_t f = 0;
size_t v = 0;
for (uint32_t i = 0; i < n; ++i, ++p) {
v8::Handle<v8::Value> key = names->Get(i);
v8::Handle<v8::Value> val = json->Get(key);
// first find an identifier for the name
TRI_Utf8ValueNFC keyStr(TRI_UNKNOWN_MEM_ZONE, key);
@ -628,9 +626,18 @@ static int FillShapeValueArray (TRI_shaper_t* shaper,
continue;
}
if ((*keyStr)[0] == '_') {
--p;
continue;
if ((*keyStr)[0] == '_' && level == 0) {
// on top level, strip reserved attributes before shaping
char const* k = (*keyStr);
if (strcmp(k, "_key") == 0 ||
strcmp(k, "_rev") == 0 ||
strcmp(k, "_id") == 0 ||
strcmp(k, "_from") == 0 ||
strcmp(k, "_to") == 0) {
// found a reserved attribute - discard it
--p;
continue;
}
}
if (create) {
@ -652,12 +659,13 @@ static int FillShapeValueArray (TRI_shaper_t* shaper,
}
}
else {
res = FillShapeValueJson(shaper, p, val, seenHashes, seenObjects, create);
v8::Handle<v8::Value> val = json->Get(key);
res = FillShapeValueJson(shaper, p, val, level + 1, seenHashes, seenObjects, create);
}
if (res != TRI_ERROR_NO_ERROR) {
for (e = p, p = values; p < e; ++p) {
if (p->_value != 0) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -706,11 +714,11 @@ static int FillShapeValueArray (TRI_shaper_t* shaper,
a = (TRI_array_shape_t*) (ptr = (char*) TRI_Allocate(shaper->_memoryZone, totalSize, true));
if (ptr == NULL) {
if (ptr == nullptr) {
e = values + n;
for (p = values; p < e; ++p) {
if (p->_value != NULL) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -746,13 +754,13 @@ static int FillShapeValueArray (TRI_shaper_t* shaper,
dst->_fixedSized = true;
dst->_size = total;
dst->_value = (ptr = (char*) TRI_Allocate(shaper->_memoryZone, dst->_size, true));
dst->_value = (ptr = static_cast<char*>(TRI_Allocate(shaper->_memoryZone, dst->_size, true)));
if (ptr == 0) {
if (ptr == nullptr) {
e = values + n;
for (p = values; p < e; ++p) {
if (p->_value != 0) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -793,7 +801,7 @@ static int FillShapeValueArray (TRI_shaper_t* shaper,
// free TRI_shape_value_t array
for (p = values; p < e; ++p) {
if (p->_value != 0) {
if (p->_value != nullptr) {
TRI_Free(shaper->_memoryZone, p->_value);
}
}
@ -803,7 +811,7 @@ static int FillShapeValueArray (TRI_shaper_t* shaper,
// lookup this shape
found = shaper->findShape(shaper, &a->base, create);
if (found == 0) {
if (found == nullptr) {
LOG_TRACE("shaper failed to find shape %d", (int) a->base._type);
TRI_Free(shaper->_memoryZone, a);
@ -826,6 +834,7 @@ static int FillShapeValueArray (TRI_shaper_t* shaper,
static int FillShapeValueJson (TRI_shaper_t* shaper,
TRI_shape_value_t* dst,
v8::Handle<v8::Value> const json,
size_t level,
set<int>& seenHashes,
vector< v8::Handle<v8::Object> >& seenObjects,
bool create) {
@ -885,11 +894,11 @@ static int FillShapeValueJson (TRI_shaper_t* shaper,
}
else if (json->IsArray()) {
return FillShapeValueList(shaper, dst, v8::Handle<v8::Array>::Cast(json), seenHashes, seenObjects, create);
return FillShapeValueList(shaper, dst, v8::Handle<v8::Array>::Cast(json), level, seenHashes, seenObjects, create);
}
else if (json->IsObject()) {
int res = FillShapeValueArray(shaper, dst, json->ToObject(), seenHashes, seenObjects, create);
int res = FillShapeValueArray(shaper, dst, json->ToObject(), level, seenHashes, seenObjects, create);
seenObjects.pop_back();
return res;
}
@ -1436,7 +1445,7 @@ TRI_shaped_json_t* TRI_ShapedJsonV8Object (v8::Handle<v8::Value> const object,
set<int> seenHashes;
vector< v8::Handle<v8::Object> > seenObjects;
int res = FillShapeValueJson(shaper, &dst, object, seenHashes, seenObjects, create);
int res = FillShapeValueJson(shaper, &dst, object, 0, seenHashes, seenObjects, create);
if (res != TRI_ERROR_NO_ERROR) {
if (res == TRI_RESULT_ELEMENT_NOT_FOUND) {
@ -1473,7 +1482,7 @@ int TRI_FillShapedJsonV8Object (v8::Handle<v8::Value> const object,
set<int> seenHashes;
vector< v8::Handle<v8::Object> > seenObjects;
int res = FillShapeValueJson(shaper, &dst, object, seenHashes, seenObjects, create);
int res = FillShapeValueJson(shaper, &dst, object, 0, seenHashes, seenObjects, create);
if (res != TRI_ERROR_NO_ERROR) {
if (res != TRI_RESULT_ELEMENT_NOT_FOUND) {
@ -1501,6 +1510,11 @@ static TRI_json_t* ObjectToJson (v8::Handle<v8::Value> const parameter,
return TRI_CreateBooleanJson(TRI_UNKNOWN_MEM_ZONE, booleanParameter->Value());
}
if (parameter->IsBooleanObject()) {
v8::Handle<v8::BooleanObject> bo = v8::Handle<v8::BooleanObject>::Cast(parameter);
return TRI_CreateBooleanJson(TRI_UNKNOWN_MEM_ZONE, bo->BooleanValue());
}
if (parameter->IsNull()) {
return TRI_CreateNullJson(TRI_UNKNOWN_MEM_ZONE);
}
@ -1509,8 +1523,13 @@ static TRI_json_t* ObjectToJson (v8::Handle<v8::Value> const parameter,
v8::Handle<v8::Number> numberParameter = parameter->ToNumber();
return TRI_CreateNumberJson(TRI_UNKNOWN_MEM_ZONE, numberParameter->Value());
}
if (parameter->IsNumberObject()) {
v8::Handle<v8::NumberObject> no = v8::Handle<v8::NumberObject>::Cast(parameter);
return TRI_CreateNumberJson(TRI_UNKNOWN_MEM_ZONE, no->NumberValue());
}
if (parameter->IsString()) {
if (parameter->IsString() || parameter->IsStringObject()) {
v8::Handle<v8::String> stringParameter= parameter->ToString();
TRI_Utf8ValueNFC str(TRI_UNKNOWN_MEM_ZONE, stringParameter);
// move the string pointer into the JSON object
@ -1523,9 +1542,9 @@ static TRI_json_t* ObjectToJson (v8::Handle<v8::Value> const parameter,
return j;
}
return 0;
return nullptr;
}
if (parameter->IsArray()) {
v8::Handle<v8::Array> arrayParameter = v8::Handle<v8::Array>::Cast(parameter);
const uint32_t n = arrayParameter->Length();
@ -1544,6 +1563,13 @@ static TRI_json_t* ObjectToJson (v8::Handle<v8::Value> const parameter,
}
return listJson;
}
if (parameter->IsRegExp() ||
parameter->IsFunction() ||
parameter->IsExternal() ||
parameter->IsDate()) {
return nullptr;
}
if (parameter->IsObject()) {
v8::Handle<v8::Object> o = parameter->ToObject();
@ -1597,7 +1623,7 @@ static TRI_json_t* ObjectToJson (v8::Handle<v8::Value> const parameter,
return arrayJson;
}
return 0;
return nullptr;
}
////////////////////////////////////////////////////////////////////////////////