mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel
This commit is contained in:
commit
e8258e4be0
|
@ -66,6 +66,10 @@ examples assume
|
|||
@anchor JSModuleGraphGraphDrop
|
||||
@copydetails JSF_Graph_prototype_drop
|
||||
|
||||
@CLEARPAGE
|
||||
@anchor JSModuleGraphGraphGetAll
|
||||
@copydetails JSF_graph_getAll
|
||||
|
||||
@CLEARPAGE
|
||||
@anchor JSModuleGraphGraphGeodesics
|
||||
@copydetails JSF_Graph_prototype_geodesics
|
||||
|
|
|
@ -13,6 +13,7 @@ TOC {#JSModuleGraphTOC}
|
|||
- @ref JSModuleGraphGraphRemoveEdge "Graph.removeEdge"
|
||||
- @ref JSModuleGraphGraphRemoveVertex "Graph.removeVertex"
|
||||
- @ref JSModuleGraphGraphDrop "Graph.drop"
|
||||
- @ref JSModuleGraphGraphGetAll "Graph.getAll"
|
||||
- @ref JSModuleGraphGraphGeodesics "Graph.geodesics"
|
||||
- @ref JSModuleGraphGraphMeasurement "Graph.measurement"
|
||||
- @ref JSModuleGraphGraphNormalizedMeasurement "Graph.normalizedMeasurement"
|
||||
|
|
|
@ -331,8 +331,13 @@ Examples{#RefManualReplicationExamples}
|
|||
|
||||
If the event contains the `oldRev` attribute, then the operation was carried out
|
||||
as an update of an existing document. The `oldRev` attribute contains the
|
||||
revision id of the replaced document. If the `oldRev` attribute is not present,
|
||||
the operation was carried out as an insert.
|
||||
revision id of the updated/replaced document. `data` will contain the full
|
||||
document and not just the updated/replaced parts.
|
||||
|
||||
If the `oldRev` attribute is not present, the operation was carried out as an insert.
|
||||
Note that some API methods cannot distinguish between inserts and updates, and
|
||||
will return any operation as an insert. Replication clients should therefore first
|
||||
check for document existance and then either carry out an insert or an update.
|
||||
|
||||
The `data` attribute contains the actual document, with the usual `_key` and
|
||||
`_rev` attributes plus all user-defined data.
|
||||
|
@ -371,9 +376,12 @@ Examples{#RefManualReplicationExamples}
|
|||
|
||||
- 2301: edge insert/update operation:
|
||||
|
||||
This event is logged for edge inserts/updates. The structure is the same as for
|
||||
the document insert/update event. Additional, the `data` attribute will contain the
|
||||
sub-attributes `_from` and `_to`, which indicate the vertices connected by the edge.
|
||||
This event is logged for edge inserts/updates. The structure and meanings are the
|
||||
same as for the document insert/update event.
|
||||
|
||||
Additional, the `data` attribute will contain the sub-attributes `_from` and `_to`,
|
||||
which indicate the vertices connected by the edge.
|
||||
|
||||
`_from` and `_to` will contain the vertex collection id plus the vertex document key:
|
||||
|
||||
{
|
||||
|
@ -431,3 +439,10 @@ If a replication client encounters some unexpected event during a transaction (i
|
|||
event that is neither a ocument/edge operation nor a `transaction commit` event), it
|
||||
should abort the ongoing transaction and discard all buffered operations. It can then
|
||||
consider the current transaction as failed.
|
||||
|
||||
Collections{#RefManualReplicationCollections}
|
||||
---------------------------------------------
|
||||
|
||||
The replication logger will only log events that affect user-defined collections. Any
|
||||
events for system collections (collections with names that start with an underscore) are
|
||||
not logged by the replication logger, and thus cannot be fetched from the continuous log.
|
||||
|
|
|
@ -6,3 +6,4 @@ TOC {#RefManualReplicationTOC}
|
|||
- @ref RefManualReplicationEventTypes
|
||||
- @ref RefManualReplicationExamples
|
||||
- @ref RefManualReplicationTransactions
|
||||
- @ref RefManualReplicationCollections
|
||||
|
|
|
@ -95,6 +95,11 @@ def Typography(txt):
|
|||
txt = FN(txt)
|
||||
txt = LIT(txt)
|
||||
txt = FA(txt)
|
||||
|
||||
# no way to find out the correct link for Swagger,
|
||||
#so replace all @ref elements with just "the manual"
|
||||
r = rc(r"""@ref [a-zA-Z0-9]+""", MS)
|
||||
txt = r.sub("the manual", txt)
|
||||
return txt
|
||||
|
||||
class InitializationError(Exception): pass
|
||||
|
|
|
@ -320,6 +320,9 @@ uint64_t RestReplicationHandler::determineChunkSize () const {
|
|||
/// @RESTRETURNCODE{200}
|
||||
/// is returned if the logger was started successfully, or was already running.
|
||||
///
|
||||
/// @RESTRETURNCODE{405}
|
||||
/// is returned when an invalid HTTP method is used.
|
||||
///
|
||||
/// @RESTRETURNCODE{500}
|
||||
/// is returned if the logger could not be started.
|
||||
///
|
||||
|
@ -377,6 +380,9 @@ void RestReplicationHandler::handleCommandLoggerStart () {
|
|||
/// is returned if the logger was stopped successfully, or was not running
|
||||
/// before.
|
||||
///
|
||||
/// @RESTRETURNCODE{405}
|
||||
/// is returned when an invalid HTTP method is used.
|
||||
///
|
||||
/// @RESTRETURNCODE{500}
|
||||
/// is returned if the logger could not be stopped.
|
||||
///
|
||||
|
@ -457,6 +463,9 @@ void RestReplicationHandler::handleCommandLoggerStop () {
|
|||
/// @RESTRETURNCODE{200}
|
||||
/// is returned if the logger state could be determined successfully.
|
||||
///
|
||||
/// @RESTRETURNCODE{405}
|
||||
/// is returned when an invalid HTTP method is used.
|
||||
///
|
||||
/// @RESTRETURNCODE{500}
|
||||
/// is returned if the logger state could not be determined.
|
||||
///
|
||||
|
@ -515,10 +524,10 @@ void RestReplicationHandler::handleCommandLoggerState () {
|
|||
///
|
||||
/// @RESTQUERYPARAMETERS
|
||||
///
|
||||
/// @RESTQUERYPARAM{from,string,optional}
|
||||
/// @RESTQUERYPARAM{from,number,optional}
|
||||
/// Lower bound tick value for results.
|
||||
///
|
||||
/// @RESTQUERYPARAM{to,string,optional}
|
||||
/// @RESTQUERYPARAM{to,number,optional}
|
||||
/// Upper bound tick value for results.
|
||||
///
|
||||
/// @RESTQUERYPARAM{chunkSize,number,optional}
|
||||
|
@ -543,7 +552,7 @@ void RestReplicationHandler::handleCommandLoggerState () {
|
|||
/// incrementally fetching log data.
|
||||
///
|
||||
/// The `to` URL parameter can be used to optionally restrict the upper bound of
|
||||
/// the result to a certain tick. If used, the result will contain only log events
|
||||
/// the result to a certain tick value. If used, the result will contain only log events
|
||||
/// with tick values up to (including) `to`. In incremental fetching, there is no
|
||||
/// need to use the `to` parameter. It only makes sense in special situations,
|
||||
/// when only parts of the change log are required.
|
||||
|
@ -582,10 +591,17 @@ void RestReplicationHandler::handleCommandLoggerState () {
|
|||
/// - `rev`: document revision id
|
||||
///
|
||||
/// - `data`: the original document data
|
||||
///
|
||||
/// A more detailed description of the individual replication event types and their
|
||||
/// data structures can be found in @ref RefManualReplicationEventTypes.
|
||||
///
|
||||
/// The response will also contain the following HTTP headers:
|
||||
///
|
||||
/// - `x-arango-replication-active`: whether or not the logger is active
|
||||
/// - `x-arango-replication-active`: whether or not the logger is active. Clients
|
||||
/// can use this flag as an indication for their polling frequency. If the
|
||||
/// logger is not active and there are no more replication events available, it
|
||||
/// might be sensible for a client to abort, or to go to sleep for a long time
|
||||
/// and try again later to check whether the logger has been activated.
|
||||
///
|
||||
/// - `x-arango-replication-lastincluded`: the tick value of the last included
|
||||
/// value in the result. In incremental log fetching, this value can be used
|
||||
|
@ -610,10 +626,23 @@ void RestReplicationHandler::handleCommandLoggerState () {
|
|||
/// @RESTRETURNCODES
|
||||
///
|
||||
/// @RESTRETURNCODE{200}
|
||||
/// is returned if the logger state could be determined successfully.
|
||||
/// is returned if the request was executed successfully, and there are log
|
||||
/// events available for the requested range. The response body will not be empty
|
||||
/// in this case.
|
||||
///
|
||||
/// @RESTRETURNCODE{204}
|
||||
/// is returned if the request was executed successfully, but there are no log
|
||||
/// events available for the requested range. The response body will be empty
|
||||
/// in this case.
|
||||
///
|
||||
/// @RESTRETURNCODE{400}
|
||||
/// is returned if either the `from` or `to` values are invalid.
|
||||
///
|
||||
/// @RESTRETURNCODE{405}
|
||||
/// is returned when an invalid HTTP method is used.
|
||||
///
|
||||
/// @RESTRETURNCODE{500}
|
||||
/// is returned if the logger state could not be determined.
|
||||
/// is returned if an error occurred while assembling the response.
|
||||
///
|
||||
/// @EXAMPLES
|
||||
///
|
||||
|
@ -778,7 +807,116 @@ void RestReplicationHandler::handleCommandLoggerFollow () {
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief return the inventory (current replication and collection state)
|
||||
/// @brief returns the server inventory
|
||||
///
|
||||
/// @RESTHEADER{GET /_api/replication/inventory,returns an inventory of collections and indexes}
|
||||
///
|
||||
/// @RESTDESCRIPTION
|
||||
/// Returns the list of collections and indexes available on the server. This
|
||||
/// list can be used by replication clients to initiate an initial sync with the
|
||||
/// server.
|
||||
///
|
||||
/// The response will contain a JSON hash array with the `collection` and `state`
|
||||
/// attributes.
|
||||
///
|
||||
/// `collections` is a list of collections with the following sub-attributes:
|
||||
///
|
||||
/// - `parameters`: the collection properties
|
||||
///
|
||||
/// - `indexes`: a list of the indexes of a the collection. Primary indexes and edges indexes
|
||||
/// are not included in this list.
|
||||
///
|
||||
/// The `state` attribute contains the current state of the replication logger. It
|
||||
/// contains the following sub-attributes:
|
||||
///
|
||||
/// - `running`: whether or not the replication logger is currently active
|
||||
///
|
||||
/// - `lastLogTick`: the value of the last tick the replication logger has written
|
||||
///
|
||||
/// - `time`: the current time on the server
|
||||
///
|
||||
/// Replication clients should note the `lastLogTick` value returned. They can then
|
||||
/// fetch collections' data using the dump method up to the value of lastLogTick, and
|
||||
/// query the continuous replication log for log events after this tick value.
|
||||
///
|
||||
/// To create a full copy of the collections on the logger server, a replication client
|
||||
/// can execute these steps:
|
||||
///
|
||||
/// - call the `/inventory` API method. This returns the `lastLogTick` value and the
|
||||
/// list of collections and indexes from the logger server.
|
||||
///
|
||||
/// - for each collection returned by `/inventory`, create the collection locally and
|
||||
/// call `/dump` to stream the collection data to the client, up to the value of
|
||||
/// `lastLogTick`.
|
||||
/// After that, the client can create the indexes on the collections as they were
|
||||
/// reported by `/inventory`.
|
||||
///
|
||||
/// If the clients wants to continuously stream replication log events from the logger
|
||||
/// server, the following additional steps need to be carried out:
|
||||
///
|
||||
/// - the client should call `/logger-follow` initially to fetch the first batch of
|
||||
/// replication events that were logged after the client's call to `/inventory`.
|
||||
///
|
||||
/// The call to `/logger-follow` should use a `from` parameter with the value of the
|
||||
/// `lastLogTick` as reported by `/inventory`. The call to `/logger-follow` will return the
|
||||
/// `x-arango-replication-lastincluded` which will contain the last tick value included
|
||||
/// in the response.
|
||||
///
|
||||
/// - the client can then continuously call `/logger-follow` to incrementally fetch new
|
||||
/// replication events that occurred after the last transfer.
|
||||
///
|
||||
/// Calls should use a `from` parameter with the value of the `x-arango-replication-lastincluded`
|
||||
/// header of the previous response. If there are no more replication events, the
|
||||
/// response will be empty and clients can go to sleep for a while and try again
|
||||
/// later.
|
||||
///
|
||||
/// @RESTRETURNCODES
|
||||
///
|
||||
/// @RESTRETURNCODE{200}
|
||||
/// is returned if the request was executed successfully.
|
||||
///
|
||||
/// @RESTRETURNCODE{405}
|
||||
/// is returned when an invalid HTTP method is used.
|
||||
///
|
||||
/// @RESTRETURNCODE{500}
|
||||
/// is returned if an error occurred while assembling the response.
|
||||
///
|
||||
/// @EXAMPLES
|
||||
///
|
||||
/// @EXAMPLE_ARANGOSH_RUN{RestReplicationInventory}
|
||||
/// var url = "/_api/replication/inventory";
|
||||
/// var response = logCurlRequest('GET', url);
|
||||
///
|
||||
/// assert(response.code === 200);
|
||||
///
|
||||
/// logJsonResponse(response);
|
||||
/// @END_EXAMPLE_ARANGOSH_RUN
|
||||
///
|
||||
/// With some additional indexes:
|
||||
///
|
||||
/// @EXAMPLE_ARANGOSH_RUN{RestReplicationInventoryIndexes}
|
||||
/// db._drop("IndexedCollection1");
|
||||
/// var c1 = db._create("IndexedCollection1");
|
||||
/// c1.ensureHashIndex("name");
|
||||
/// c1.ensureUniqueSkiplist("a", "b");
|
||||
/// c1.ensureCapConstraint(500);
|
||||
///
|
||||
/// db._drop("IndexedCollection2");
|
||||
/// var c2 = db._create("IndexedCollection2");
|
||||
/// c2.ensureFulltextIndex("text", 10);
|
||||
/// c2.ensureSkiplist("a");
|
||||
/// c2.ensureCapConstraint(0, 1048576);
|
||||
///
|
||||
/// var url = "/_api/replication/inventory";
|
||||
/// var response = logCurlRequest('GET', url);
|
||||
///
|
||||
/// assert(response.code === 200);
|
||||
/// logJsonResponse(response);
|
||||
///
|
||||
/// db._flushCache();
|
||||
/// db._drop("IndexedCollection1");
|
||||
/// db._drop("IndexedCollection2");
|
||||
/// @END_EXAMPLE_ARANGOSH_RUN
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void RestReplicationHandler::handleCommandInventory () {
|
||||
|
@ -820,7 +958,124 @@ void RestReplicationHandler::handleCommandInventory () {
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief handle a dump command for a specific collection
|
||||
/// @brief dumps the data of a collection
|
||||
///
|
||||
/// @RESTHEADER{GET /_api/replication/dump,returns the data of a collection}
|
||||
///
|
||||
/// @RESTQUERYPARAMETERS
|
||||
///
|
||||
/// @RESTQUERYPARAM{collection,string,required}
|
||||
/// The name or id of the collection to dump.
|
||||
///
|
||||
/// @RESTQUERYPARAM{from,number,optional}
|
||||
/// Lower bound tick value for results.
|
||||
///
|
||||
/// @RESTQUERYPARAM{to,number,optional}
|
||||
/// Upper bound tick value for results.
|
||||
///
|
||||
/// @RESTQUERYPARAM{chunkSize,number,optional}
|
||||
/// Approximate maximum size of the returned result.
|
||||
///
|
||||
/// @RESTDESCRIPTION
|
||||
/// Returns the data from the collection for the requested range.
|
||||
///
|
||||
/// When the `from` URL parameter is not used, collection events are returned from
|
||||
/// the beginning. When the `from` parameter is used, the result will only contain
|
||||
/// collection entries which have higher tick values than the specified `from` value
|
||||
/// (note: the log entry with a tick value equal to `from` will be excluded).
|
||||
///
|
||||
/// The `to` URL parameter can be used to optionally restrict the upper bound of
|
||||
/// the result to a certain tick value. If used, the result will only contain
|
||||
/// collection entries with tick values up to (including) `to`.
|
||||
///
|
||||
/// The `chunkSize` URL parameter can be used to control the size of the result.
|
||||
/// It must be specified in bytes. The `chunkSize` value will only be honored
|
||||
/// approximately. Otherwise a too low `chunkSize` value could cause the server
|
||||
/// to not be able to put just one entry into the result and return it.
|
||||
/// Therefore, the `chunkSize` value will only be consulted after an entry has
|
||||
/// been written into the result. If the result size is then bigger than
|
||||
/// `chunkSize`, the server will respond with as many entries as there are
|
||||
/// in the response already. If the result size is still smaller than `chunkSize`,
|
||||
/// the server will try to return more data if there's more data left to return.
|
||||
///
|
||||
/// If `chunkSize` is not specified, some server-side default value will be used.
|
||||
///
|
||||
/// The `Content-Type` of the result is `application/x-arango-dump`. This is an
|
||||
/// easy-to-process format, with all entries going onto separate lines in the
|
||||
/// response body.
|
||||
///
|
||||
/// Each line itself is a JSON hash, with at least the following attributes:
|
||||
///
|
||||
/// - `type`: the type of entry. Possible values for `type` are:
|
||||
///
|
||||
/// - 2300: document insertion/update
|
||||
///
|
||||
/// - 2301: edge insertion/update
|
||||
///
|
||||
/// - 2302: document/edge deletion
|
||||
///
|
||||
/// - `key`: the key of the document/edge or the key used in the deletion operation
|
||||
///
|
||||
/// - `rev`: the revision id of the document/edge or the deletion operation
|
||||
///
|
||||
/// - `data`: the actual document/edge data for types 2300 and 2301. The full
|
||||
/// document/edge data will be returned even for updates.
|
||||
///
|
||||
/// A more detailed description of the different entry types and their
|
||||
/// data structures can be found in @ref RefManualReplicationEventTypes.
|
||||
///
|
||||
/// Note: there will be no distinction between inserts and updates when calling this method.
|
||||
///
|
||||
/// @RESTRETURNCODES
|
||||
///
|
||||
/// @RESTRETURNCODE{200}
|
||||
/// is returned if the request was executed successfully.
|
||||
///
|
||||
/// @RESTRETURNCODE{400}
|
||||
/// is returned if either the `from` or `to` values are invalid.
|
||||
///
|
||||
/// @RESTRETURNCODE{404}
|
||||
/// is returned when the collection could not be found.
|
||||
///
|
||||
/// @RESTRETURNCODE{500}
|
||||
/// is returned if an error occurred while assembling the response.
|
||||
///
|
||||
/// @EXAMPLES
|
||||
///
|
||||
/// Empty collection:
|
||||
///
|
||||
/// @EXAMPLE_ARANGOSH_RUN{RestReplicationDumpEmpty}
|
||||
/// db._drop("testCollection");
|
||||
/// var c = db._create("testCollection");
|
||||
/// var url = "/_api/replication/dump?collection=" + c.name();
|
||||
/// var response = logCurlRequest('GET', url);
|
||||
///
|
||||
/// assert(response.code === 204);
|
||||
/// logRawResponse(response);
|
||||
///
|
||||
/// c.drop();
|
||||
/// @END_EXAMPLE_ARANGOSH_RUN
|
||||
///
|
||||
/// Non-empty collection:
|
||||
///
|
||||
/// @EXAMPLE_ARANGOSH_RUN{RestReplicationDump}
|
||||
/// db._drop("testCollection");
|
||||
/// var c = db._create("testCollection");
|
||||
/// c.save({ "test" : true, "a" : "abc", "_key" : "abcdef" });
|
||||
/// c.save({ "b" : 1, "c" : false, "_key" : "123456" });
|
||||
/// c.update("123456", { "d" : "additional value" });
|
||||
/// c.save({ "_key": "foobar" });
|
||||
/// c.remove("foobar");
|
||||
/// c.remove("abcdef");
|
||||
///
|
||||
/// var url = "/_api/replication/dump?collection=" + c.name();
|
||||
/// var response = logCurlRequest('GET', url);
|
||||
///
|
||||
/// assert(response.code === 200);
|
||||
/// logRawResponse(response);
|
||||
///
|
||||
/// c.drop();
|
||||
/// @END_EXAMPLE_ARANGOSH_RUN
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void RestReplicationHandler::handleCommandDump () {
|
||||
|
@ -897,7 +1152,14 @@ void RestReplicationHandler::handleCommandDump () {
|
|||
|
||||
if (res == TRI_ERROR_NO_ERROR) {
|
||||
// generate the result
|
||||
_response = createResponse(HttpResponse::OK);
|
||||
const size_t length = TRI_LengthStringBuffer(dump._buffer);
|
||||
|
||||
if (length == 0) {
|
||||
_response = createResponse(HttpResponse::NO_CONTENT);
|
||||
}
|
||||
else {
|
||||
_response = createResponse(HttpResponse::OK);
|
||||
}
|
||||
|
||||
_response->setContentType("application/x-arango-dump; charset=utf-8");
|
||||
|
||||
|
@ -911,7 +1173,7 @@ void RestReplicationHandler::handleCommandDump () {
|
|||
StringUtils::itoa(dump._lastFoundTick));
|
||||
|
||||
// transfer ownership of the buffer contents
|
||||
_response->body().appendText(TRI_BeginStringBuffer(dump._buffer), TRI_LengthStringBuffer(dump._buffer));
|
||||
_response->body().appendText(TRI_BeginStringBuffer(dump._buffer), length);
|
||||
// avoid double freeing
|
||||
TRI_StealStringBuffer(dump._buffer);
|
||||
|
||||
|
|
|
@ -234,8 +234,10 @@ static bool StringifyMarkerDump (TRI_string_buffer_t* buffer,
|
|||
TRI_voc_key_t key;
|
||||
TRI_voc_rid_t rid;
|
||||
|
||||
APPEND_CHAR(buffer, '{');
|
||||
|
||||
if (buffer == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (marker->_type == TRI_DOC_MARKER_KEY_DELETION) {
|
||||
TRI_doc_deletion_key_marker_t const* m = (TRI_doc_deletion_key_marker_t const*) marker;
|
||||
key = ((char*) m) + m->_offsetKey;
|
||||
|
@ -257,8 +259,11 @@ static bool StringifyMarkerDump (TRI_string_buffer_t* buffer,
|
|||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
APPEND_STRING(buffer, "{\"tick\":\"");
|
||||
APPEND_UINT64(buffer, (uint64_t) marker->_tick);
|
||||
|
||||
APPEND_STRING(buffer, "\"type\":");
|
||||
APPEND_STRING(buffer, "\",\"type\":");
|
||||
APPEND_UINT64(buffer, (uint64_t) type);
|
||||
APPEND_STRING(buffer, ",\"key\":\"");
|
||||
// key is user-defined, but does not need escaping
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"swaggerVersion": "1.1",
|
||||
"apiVersion": "1.4",
|
||||
"apiVersion": "1.4.devel",
|
||||
"apis": [
|
||||
{
|
||||
"path": "api-docs/aqlfunction.{format}",
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"notes": "Creates an new collection with a given name. The request must contain an object with the following attributes. <br><br>- <em>name</em>: The name of the collection.<br><br>- <em>waitForSync</em> (optional, default: false): If <em>true</em> then the data is synchronised to disk before returning from a create or update of a document. <br><br>- <em>doCompact</em> (optional, default is <em>true</em>): whether or not the collection will be compacted. <br><br>- <em>journalSize</em> (optional, default is a @ref CommandLineArangod \"configuration parameter\"): The maximal size of a journal or datafile. Note that this also limits the maximal size of a single object. Must be at least 1MB. <br><br>- <em>isSystem</em> (optional, default is <em>false</em>): If <em>true</em>, create a system collection. In this case <em>collection-name</em> should start with an underscore. End users should normally create non-system collections only. API implementors may be required to create system collections in very special occasions, but normally a regular collection will do. <br><br>- <em>isVolatile</em> (optional, default is <em>false</em>): If <em>true</em> then the collection data is kept in-memory only and not made persistent. Unloading the collection will cause the collection data to be discarded. Stopping or re-starting the server will also cause full loss of data in the collection. Setting this option will make the resulting collection be slightly faster than regular collections because ArangoDB does not enforce any synchronisation to disk and does not calculate any CRC checksums for datafiles (as there are no datafiles). <br><br> This option should threrefore be used for cache-type collections only, and not for data that cannot be re-created otherwise. <br><br>- <em>keyOptions</em> (optional) additional options for key generation. If specified, then <em>keyOptions</em> should be a JSON array containing the following attributes (note: some of them are optional): - <em>type</em>: specifies the type of the key generator. The currently available generators are <em>traditional</em> and <em>autoincrement</em>. - <em>allowUserKeys</em>: if set to <em>true</em>, then it is allowed to supply own key values in the <em>_key</em> attribute of a document. If set to <em>false</em>, then the key generator will solely be responsible for generating keys and supplying own key values in the <em>_key</em> attribute of documents is considered an error. - <em>increment</em>: increment value for <em>autoincrement</em> key generator. Not used for other key generator types. - <em>offset</em>: initial offset value for <em>autoincrement</em> key generator. Not used for other key generator types. <br><br>- <em>type</em> (optional, default is <em>2</em>): the type of the collection to create. The following values for <em>type</em> are valid: - <em>2</em>: document collection - <em>3</em>: edges collection <br><br>",
|
||||
"summary": "creates a collection",
|
||||
"httpMethod": "POST",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/collection\n{ \"name\": \"testCollectionBasics\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/testCollectionBasics\n\n{ \n \"id\" : \"23559484\", \n \"name\" : \"testCollectionBasics\", \n \"waitForSync\" : false, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\nunix> curl -X POST --data @- --dump - http://localhost:8529/_api/collection\n{ \"name\": \"testCollectionEdges\", \"type\" : 3 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/testCollectionEdges\n\n{ \n \"id\" : \"24542524\", \n \"name\" : \"testCollectionEdges\", \n \"waitForSync\" : false, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"status\" : 3, \n \"type\" : 3, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/collection\n{ \"name\": \"testCollectionUsers\", \"keyOptions\" : { \"type\" : \"autoincrement\", \"increment\" : 5, \"allowUserKeys\" : true }}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/testCollectionUsers\n\n{ \n \"id\" : \"25394492\", \n \"name\" : \"testCollectionUsers\", \n \"waitForSync\" : false, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/collection\n{\"name\":\"testCollectionBasics\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/testCollectionBasics\n\n{ \n \"id\" : \"17550430\", \n \"name\" : \"testCollectionBasics\", \n \"waitForSync\" : false, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\nunix> curl -X POST --data @- --dump - http://localhost:8529/_api/collection\n{\"name\":\"testCollectionEdges\",\"type\":3}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/testCollectionEdges\n\n{ \n \"id\" : \"18533470\", \n \"name\" : \"testCollectionEdges\", \n \"waitForSync\" : false, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"status\" : 3, \n \"type\" : 3, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/collection\n{\"name\":\"testCollectionUsers\",\"keyOptions\":{\"type\":\"autoincrement\",\"increment\":5,\"allowUserKeys\":true}}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/testCollectionUsers\n\n{ \n \"id\" : \"19450974\", \n \"name\" : \"testCollectionUsers\", \n \"waitForSync\" : false, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "createsACollection"
|
||||
}
|
||||
],
|
||||
|
@ -41,7 +41,7 @@
|
|||
"notes": "Returns an object with an attribute <em>collections</em> containing a list of all collection descriptions. The same information is also available in the <em>names</em> as hash map with the collection names as keys. <br><br>By providing the optional URL parameter <em>excludeSystem</em> with a value of <em>true</em>, all system collections will be excluded from the response. <br><br>",
|
||||
"summary": "reads all collections",
|
||||
"httpMethod": "GET",
|
||||
"examples": "Return information about all collections: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"collections\" : [ \n { \n \"id\" : \"8813884\", \n \"name\" : \"_replication\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"20806972\", \n \"name\" : \"animals\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"4685116\", \n \"name\" : \"_structures\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"5471548\", \n \"name\" : \"_aal\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"24542524\", \n \"name\" : \"testCollectionEdges\", \n \"status\" : 3, \n \"type\" : 3 \n }, \n { \n \"id\" : \"6978876\", \n \"name\" : \"_fishbowl\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"6323516\", \n \"name\" : \"_aqlfunctions\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"25394492\", \n \"name\" : \"testCollectionUsers\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"1473852\", \n \"name\" : \"_graphs\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"2915644\", \n \"name\" : \"_routing\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"97596\", \n \"name\" : \"_users\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"2260284\", \n \"name\" : \"_modules\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"8027452\", \n \"name\" : \"_trx\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"19299644\", \n \"name\" : \"demo\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"23559484\", \n \"name\" : \"testCollectionBasics\", \n \"status\" : 3, \n \"type\" : 2 \n } \n ], \n \"names\" : { \n \"_replication\" : { \n \"id\" : \"8813884\", \n \"name\" : \"_replication\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"animals\" : { \n \"id\" : \"20806972\", \n \"name\" : \"animals\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_structures\" : { \n \"id\" : \"4685116\", \n \"name\" : \"_structures\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_aal\" : { \n \"id\" : \"5471548\", \n \"name\" : \"_aal\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"testCollectionEdges\" : { \n \"id\" : \"24542524\", \n \"name\" : \"testCollectionEdges\", \n \"status\" : 3, \n \"type\" : 3 \n }, \n \"_fishbowl\" : { \n \"id\" : \"6978876\", \n \"name\" : \"_fishbowl\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_aqlfunctions\" : { \n \"id\" : \"6323516\", \n \"name\" : \"_aqlfunctions\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"testCollectionUsers\" : { \n \"id\" : \"25394492\", \n \"name\" : \"testCollectionUsers\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_graphs\" : { \n \"id\" : \"1473852\", \n \"name\" : \"_graphs\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_routing\" : { \n \"id\" : \"2915644\", \n \"name\" : \"_routing\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_users\" : { \n \"id\" : \"97596\", \n \"name\" : \"_users\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_modules\" : { \n \"id\" : \"2260284\", \n \"name\" : \"_modules\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_trx\" : { \n \"id\" : \"8027452\", \n \"name\" : \"_trx\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"demo\" : { \n \"id\" : \"19299644\", \n \"name\" : \"demo\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"testCollectionBasics\" : { \n \"id\" : \"23559484\", \n \"name\" : \"testCollectionBasics\", \n \"status\" : 3, \n \"type\" : 2 \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"examples": "Return information about all collections: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"collections\" : [ \n { \n \"id\" : \"8047710\", \n \"name\" : \"_trx\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"8834142\", \n \"name\" : \"_replication\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"4705374\", \n \"name\" : \"_structures\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"5491806\", \n \"name\" : \"_aal\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"13290590\", \n \"name\" : \"demo\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"6999134\", \n \"name\" : \"_fishbowl\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"6343774\", \n \"name\" : \"_aqlfunctions\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"14797918\", \n \"name\" : \"animals\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"1494110\", \n \"name\" : \"_graphs\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"117854\", \n \"name\" : \"_users\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"2280542\", \n \"name\" : \"_modules\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"3001438\", \n \"name\" : \"_routing\", \n \"status\" : 3, \n \"type\" : 2 \n } \n ], \n \"names\" : { \n \"_trx\" : { \n \"id\" : \"8047710\", \n \"name\" : \"_trx\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_replication\" : { \n \"id\" : \"8834142\", \n \"name\" : \"_replication\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_structures\" : { \n \"id\" : \"4705374\", \n \"name\" : \"_structures\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_aal\" : { \n \"id\" : \"5491806\", \n \"name\" : \"_aal\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"demo\" : { \n \"id\" : \"13290590\", \n \"name\" : \"demo\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_fishbowl\" : { \n \"id\" : \"6999134\", \n \"name\" : \"_fishbowl\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_aqlfunctions\" : { \n \"id\" : \"6343774\", \n \"name\" : \"_aqlfunctions\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"animals\" : { \n \"id\" : \"14797918\", \n \"name\" : \"animals\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_graphs\" : { \n \"id\" : \"1494110\", \n \"name\" : \"_graphs\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_users\" : { \n \"id\" : \"117854\", \n \"name\" : \"_users\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_modules\" : { \n \"id\" : \"2280542\", \n \"name\" : \"_modules\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_routing\" : { \n \"id\" : \"3001438\", \n \"name\" : \"_routing\", \n \"status\" : 3, \n \"type\" : 2 \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "readsAllCollections"
|
||||
}
|
||||
],
|
||||
|
@ -99,7 +99,7 @@
|
|||
"notes": "In addition to the above, the result will always contain the <em>waitForSync</em>, <em>doCompact</em>, <em>journalSize</em>, and <em>isVolatile</em> properties. This is achieved by forcing a load of the underlying collection. <br><br>- <em>waitForSync</em>: If <em>true</em> then creating or changing a document will wait until the data has been synchronised to disk. <br><br>- <em>doCompact</em>: Whether or not the collection will be compacted.<br><br>- <em>journalSize</em>: The maximal size setting for journals / datafiles.<br><br>- <em>isVolatile</em>: If <em>true</em> then the collection data will be kept in memory only and ArangoDB will not write or sync the data to disk. <br><br>",
|
||||
"summary": "reads the properties of a collection",
|
||||
"httpMethod": "GET",
|
||||
"examples": "Using an identifier: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/26180924/properties\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/products/properties\n\n{ \n \"id\" : \"26180924\", \n \"name\" : \"products\", \n \"doCompact\" : true, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Using a name: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/products/properties\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/products/properties\n\n{ \n \"id\" : \"26901820\", \n \"name\" : \"products\", \n \"doCompact\" : true, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"examples": "Using an identifier: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/20106334/properties\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/products/properties\n\n{ \n \"id\" : \"20106334\", \n \"name\" : \"products\", \n \"doCompact\" : true, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Using a name: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/products/properties\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/products/properties\n\n{ \n \"id\" : \"20761694\", \n \"name\" : \"products\", \n \"doCompact\" : true, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "readsThePropertiesOfACollection"
|
||||
}
|
||||
],
|
||||
|
@ -130,7 +130,7 @@
|
|||
"notes": "In addition to the above, the result also contains the number of documents. Note that this will always load the collection into memory. <br><br>- <em>count</em>: The number of documents inside the collection.<br><br>",
|
||||
"summary": "returns the number of documents in a collection",
|
||||
"httpMethod": "GET",
|
||||
"examples": "Using an identifier and requesting the number of documents: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/27557180/count\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/products/count\n\n{ \n \"id\" : \"27557180\", \n \"name\" : \"products\", \n \"doCompact\" : true, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"count\" : 100, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"examples": "Using an identifier and requesting the number of documents: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/21482590/count\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/products/count\n\n{ \n \"id\" : \"21482590\", \n \"name\" : \"products\", \n \"doCompact\" : true, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"count\" : 100, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "returnsTheNumberOfDocumentsInACollection"
|
||||
}
|
||||
],
|
||||
|
@ -161,7 +161,7 @@
|
|||
"notes": "In addition to the above, the result also contains the number of documents and additional statistical information about the collection. Note that this will always load the collection into memory. <br><br>- <em>count</em>: The number of documents inside the collection.<br><br>- <em>figures.alive.count</em>: The number of living documents.<br><br>- <em>figures.alive.size</em>: The total size in bytes used by all living documents. <br><br>- <em>figures.dead.count</em>: The number of dead documents.<br><br>- <em>figures.dead.size</em>: The total size in bytes used by all dead documents. <br><br>- <em>figures.dead.deletion</em>: The total number of deletion markers.<br><br>- <em>figures.datafiles.count</em>: The number of active datafiles.- <em>figures.datafiles.fileSize</em>: The total filesize of datafiles.<br><br>- <em>figures.journals.count</em>: The number of journal files.- <em>figures.journals.fileSize</em>: The total filesize of journal files.<br><br>- <em>figures.shapes.count</em>: The total number of shapes used in the collection (this includes shapes that are not in use anymore) <br><br>- <em>figures.attributes.count</em>: The total number of attributes used in the collection (this includes attributes that are not in use anymore) <br><br>- <em>journalSize</em>: The maximal size of the journal in bytes.<br><br>Note: the filesizes of shapes and compactor files are not reported. <br><br>",
|
||||
"summary": "returns the stats for a collection",
|
||||
"httpMethod": "GET",
|
||||
"examples": "Using an identifier and requesting the figures of the collection: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/48135484/figures\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/products/figures\n\n{ \n \"id\" : \"48135484\", \n \"name\" : \"products\", \n \"doCompact\" : true, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"count\" : 0, \n \"figures\" : { \n \"alive\" : { \n \"count\" : 0, \n \"size\" : 0 \n }, \n \"dead\" : { \n \"count\" : 0, \n \"size\" : 0, \n \"deletion\" : 0 \n }, \n \"datafiles\" : { \n \"count\" : 0, \n \"fileSize\" : 0 \n }, \n \"journals\" : { \n \"count\" : 0, \n \"fileSize\" : 0 \n }, \n \"shapes\" : { \n \"count\" : 6 \n }, \n \"attributes\" : { \n \"count\" : 0 \n } \n }, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"examples": "Using an identifier and requesting the figures of the collection: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/42060894/figures\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/products/figures\n\n{ \n \"id\" : \"42060894\", \n \"name\" : \"products\", \n \"doCompact\" : true, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"count\" : 0, \n \"figures\" : { \n \"alive\" : { \n \"count\" : 0, \n \"size\" : 0 \n }, \n \"dead\" : { \n \"count\" : 0, \n \"size\" : 0, \n \"deletion\" : 0 \n }, \n \"datafiles\" : { \n \"count\" : 0, \n \"fileSize\" : 0 \n }, \n \"journals\" : { \n \"count\" : 0, \n \"fileSize\" : 0 \n }, \n \"shapes\" : { \n \"count\" : 6 \n }, \n \"attributes\" : { \n \"count\" : 0 \n } \n }, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "returnsTheStatsForACollection"
|
||||
}
|
||||
],
|
||||
|
@ -192,7 +192,7 @@
|
|||
"notes": "In addition to the above, the result will also contain the collection's revision id. The revision id is a server-generated string that clients can use to check whether data in a collection has changed since the last revision check. <br><br>- <em>revision</em>: The collection revision id as a string.<br><br>",
|
||||
"summary": "return a collection revision id",
|
||||
"httpMethod": "GET",
|
||||
"examples": "Retrieving the revision of a collection <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/48921916/revision\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"48921916\", \n \"name\" : \"products\", \n \"status\" : 3, \n \"type\" : 2, \n \"revision\" : \"0\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"examples": "Retrieving the revision of a collection <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/42847326/revision\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"42847326\", \n \"name\" : \"products\", \n \"status\" : 3, \n \"type\" : 2, \n \"revision\" : \"0\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "returnACollectionRevisionId"
|
||||
}
|
||||
],
|
||||
|
@ -230,7 +230,7 @@
|
|||
"notes": "Will calculate checksum of the meta-data (keys and revision ids) and optionally document data in the collection. <br><br>The checksum can be used to compare if two collections on different ArangoDB instances contain the same contents. The current revision of the collection is returned too so one can make sure the checksums are calculated for the same state of data. <br><br>By default, the checksum will only be calculated on the <em>_key</em> and <em>_rev</em> system attributes of the documents contained in the collection. For edge collections, the system attributes <em>_from</em> and <em>_to</em> will also be included in the calculation. <br><br>By providing the optional URL parameter <em>withData</em> with a value of <em>true</em>, the user-defined document attributes will be included in the calculation too. Note that including user-defined attributes will make the checksumming slower. <br><br>- <em>checksum</em>: The calculated checksum as a number.<br><br>- <em>revision</em>: The collection revision id as a string.<br><br>",
|
||||
"summary": "returns a checksum for the collection",
|
||||
"httpMethod": "GET",
|
||||
"examples": "Retrieving the checksum of a collection: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/49708348/checksum\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"49708348\", \n \"name\" : \"products\", \n \"status\" : 3, \n \"type\" : 2, \n \"checksum\" : 2624992045, \n \"revision\" : \"50691388\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"examples": "Retrieving the checksum of a collection: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/43633758/checksum\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"43633758\", \n \"name\" : \"products\", \n \"status\" : 3, \n \"type\" : 2, \n \"checksum\" : 1270208492, \n \"revision\" : \"44616798\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "returnsAChecksumForTheCollection"
|
||||
}
|
||||
],
|
||||
|
@ -261,7 +261,7 @@
|
|||
"notes": "Loads a collection into memory. Returns the collection on success. <br><br>The request might optionally contain the following attribute: <br><br>- <em>count</em>: If set, this controls whether the return value should include the number of documents in the collection. Setting <em>count</em> to <em>false</em> may speed up loading a collection. The default value for <em>count</em> is <em>true</em>. <br><br>On success an object with the following attributes is returned: <br><br>- <em>id</em>: The identifier of the collection.<br><br>- <em>name</em>: The name of the collection.<br><br>- <em>count</em>: The number of documents inside the collection. This is only returned if the <em>count</em> input parameters is set to <em>true</em> or has not been specified. <br><br>- <em>status</em>: The status of the collection as number.<br><br>- <em>type</em>: The collection type. Valid types are: - 2: document collection - 3: edges collection <br><br>",
|
||||
"summary": "loads a collection",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/collection/50822460/load\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"50822460\", \n \"name\" : \"products\", \n \"count\" : 0, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/collection/44747870/load\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"44747870\", \n \"name\" : \"products\", \n \"count\" : 0, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "loadsACollection"
|
||||
}
|
||||
],
|
||||
|
@ -292,7 +292,7 @@
|
|||
"notes": "Removes a collection from memory. This call does not delete any documents. You can use the collection afterwards; in which case it will be loaded into memory, again. On success an object with the following attributes is returned: <br><br>- <em>id</em>: The identifier of the collection.<br><br>- <em>name</em>: The name of the collection.<br><br>- <em>status</em>: The status of the collection as number.<br><br>- <em>type</em>: The collection type. Valid types are: - 2: document collection - 3: edges collection <br><br>",
|
||||
"summary": "unloads a collection",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/collection/51543356/unload\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"51543356\", \n \"name\" : \"products\", \n \"status\" : 2, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/collection/45468766/unload\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"45468766\", \n \"name\" : \"products\", \n \"status\" : 2, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "unloadsACollection"
|
||||
}
|
||||
],
|
||||
|
@ -314,7 +314,7 @@
|
|||
"notes": "Removes all documents from the collection, but leaves the indexes intact. <br><br>",
|
||||
"summary": "truncates a collection",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/collection/52264252/truncate\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"52264252\", \n \"name\" : \"products\", \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/collection/46189662/truncate\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"46189662\", \n \"name\" : \"products\", \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "truncatesACollection"
|
||||
}
|
||||
],
|
||||
|
@ -336,7 +336,7 @@
|
|||
"notes": "Changes the properties of a collection. Expects an object with the attribute(s) <br><br>- <em>waitForSync</em>: If <em>true</em> then creating or changing a document will wait until the data has been synchronised to disk. <br><br>- <em>journalSize</em>: Size (in bytes) for new journal files that are created for the collection. <br><br>If returns an object with the attributes <br><br>- <em>id</em>: The identifier of the collection.<br><br>- <em>name</em>: The name of the collection.<br><br>- <em>waitForSync</em>: The new value.<br><br>- <em>journalSize</em>: The new value.<br><br>- <em>status</em>: The status of the collection as number.<br><br>- <em>type</em>: The collection type. Valid types are: - 2: document collection - 3: edges collection <br><br>Note: some other collection properties, such as <em>type</em> or <em>isVolatile</em> cannot be changed once the collection is created. <br><br>",
|
||||
"summary": "changes the properties of a collection",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/collection/52985148/properties\n{\"waitForSync\":true}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"52985148\", \n \"name\" : \"products\", \n \"doCompact\" : true, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/collection/46910558/properties\n{\"waitForSync\":true}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"46910558\", \n \"name\" : \"products\", \n \"doCompact\" : true, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "changesThePropertiesOfACollection"
|
||||
}
|
||||
],
|
||||
|
@ -358,7 +358,7 @@
|
|||
"notes": "Renames a collection. Expects an object with the attribute(s) <br><br>- <em>name</em>: The new name.<br><br>If returns an object with the attributes <br><br>- <em>id</em>: The identifier of the collection.<br><br>- <em>name</em>: The new name of the collection.<br><br>- <em>status</em>: The status of the collection as number.<br><br>- <em>type</em>: The collection type. Valid types are: - 2: document collection - 3: edges collection <br><br>",
|
||||
"summary": "renames a collection",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/collection/53706044/rename\n{\"name\":\"newname\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"53706044\", \n \"name\" : \"newname\", \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/collection/47631454/rename\n{\"name\":\"newname\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"47631454\", \n \"name\" : \"newname\", \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "renamesACollection"
|
||||
}
|
||||
],
|
||||
|
@ -389,7 +389,7 @@
|
|||
"notes": "Deletes a collection identified by <em>collection-name</em>. <br><br>If the collection was successfully deleted then, an object is returned with the following attributes: <br><br>- <em>error</em>: <em>false</em><br><br>- <em>id</em>: The identifier of the deleted collection.<br><br>",
|
||||
"summary": "deletes a collection",
|
||||
"httpMethod": "DELETE",
|
||||
"examples": "Using an identifier: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/collection/54361404\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"54361404\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Using a name: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/collection/products1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"55082300\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"examples": "Using an identifier: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/collection/48286814\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"48286814\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Using a name: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/collection/products1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"48942174\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "deletesACollection"
|
||||
}
|
||||
],
|
||||
|
|
|
@ -29,10 +29,10 @@
|
|||
"description": "The following attributes can be used inside the JSON object: - <em>query</em>: contains the query string to be executed (mandatory) - <em>count</em>: boolean flag that indicates whether the total 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. - <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. - <em>bindVars</em>: key/value list of bind parameters (optional). "
|
||||
}
|
||||
],
|
||||
"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>- <em>query</em>: contains the query string to be executed (mandatory)<br><br>- <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. <br><br>- <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. <br><br>- <em>bindVars</em>: key/value list of bind parameters (optional). <br><br>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 JSON object has the following properties: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>false</em> in this case) <br><br>- <em>code</em>: the HTTP status code<br><br>- <em>result</em>: an array of result documents (might be empty if query has no results)<br><br>- <em>hasMore</em>: a boolean indicator whether there are more results available on the server <br><br>- <em>count</em>: the total number of result documents available (only available if the query was executed with the <em>count</em> attribute set. <br><br>- <em>id</em>: id of temporary cursor created on the server (optional, see above)<br><br>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>- <em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case)<br><br>- <em>code</em>: the HTTP status code<br><br>- <em>errorNum</em>: the server error number<br><br>- <em>errorMessage</em>: a descriptive error message<br><br>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 @ref ArangoErrors here. <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>- <em>query</em>: contains the query string to be executed (mandatory)<br><br>- <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. <br><br>- <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. <br><br>- <em>bindVars</em>: key/value list of bind parameters (optional). <br><br>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 JSON object has the following properties: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>false</em> in this case) <br><br>- <em>code</em>: the HTTP status code<br><br>- <em>result</em>: an array of result documents (might be empty if query has no results)<br><br>- <em>hasMore</em>: a boolean indicator whether there are more results available on the server <br><br>- <em>count</em>: the total number of result documents available (only available if the query was executed with the <em>count</em> attribute set. <br><br>- <em>id</em>: id of temporary cursor created on the server (optional, see above)<br><br>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>- <em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case)<br><br>- <em>code</em>: the HTTP status code<br><br>- <em>errorNum</em>: the server error number<br><br>- <em>errorMessage</em>: a descriptive error message<br><br>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",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Executes a query and extract the result in a single go: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/56655164\", \n \"_rev\" : \"56655164\", \n \"_key\" : \"56655164\", \n \"hello1\" : \"world1\" \n }, \n { \n \"_id\" : \"products/57048380\", \n \"_rev\" : \"57048380\", \n \"_key\" : \"57048380\", \n \"hello2\" : \"world1\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Executes a query and extract part of the result: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/59473212\", \n \"_rev\" : \"59473212\", \n \"_key\" : \"59473212\", \n \"hello5\" : \"world1\" \n }, \n { \n \"_id\" : \"products/58096956\", \n \"_rev\" : \"58096956\", \n \"_key\" : \"58096956\", \n \"hello1\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"59669820\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Bad queries: Missing body: <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>Unknown collection: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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>",
|
||||
"examples": "Executes a query and extract the result in a single go: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/50515038\", \n \"_rev\" : \"50515038\", \n \"_key\" : \"50515038\", \n \"hello1\" : \"world1\" \n }, \n { \n \"_id\" : \"products/50908254\", \n \"_rev\" : \"50908254\", \n \"_key\" : \"50908254\", \n \"hello2\" : \"world1\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Executes a query and extract part of the result: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/52350046\", \n \"_rev\" : \"52350046\", \n \"_key\" : \"52350046\", \n \"hello2\" : \"world1\" \n }, \n { \n \"_id\" : \"products/53333086\", \n \"_rev\" : \"53333086\", \n \"_key\" : \"53333086\", \n \"hello5\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"53529694\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Bad queries: Missing body: <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>Unknown collection: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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"
|
||||
}
|
||||
],
|
||||
|
@ -63,7 +63,7 @@
|
|||
"notes": "<br><br>If the cursor is still alive, returns an object with the following attributes. <br><br>- <em>id</em>: the <em>cursor-identifier</em>- <em>result</em>: a list of documents for the current batch- <em>hasMore</em>: <em>false</em> if this was the last batch- <em>count</em>: if present the total number of elements<br><br>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",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "Valid request for next batch: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/62160188\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/61963580\", \n \"_rev\" : \"61963580\", \n \"_key\" : \"61963580\", \n \"hello5\" : \"world1\" \n }, \n { \n \"_id\" : \"products/60652860\", \n \"_rev\" : \"60652860\", \n \"_key\" : \"60652860\", \n \"hello1\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"62160188\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Missing identifier <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>Unknown identifier <br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/cursor/123123\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1600, \n \"errorMessage\" : \"cursor not found\" \n}\n\n</code></pre><br>",
|
||||
"examples": "Valid request for next batch: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/56020062\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/55823454\", \n \"_rev\" : \"55823454\", \n \"_key\" : \"55823454\", \n \"hello5\" : \"world1\" \n }, \n { \n \"_id\" : \"products/55168094\", \n \"_rev\" : \"55168094\", \n \"_key\" : \"55168094\", \n \"hello3\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"56020062\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Missing identifier <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>Unknown identifier <br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/cursor/123123\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1600, \n \"errorMessage\" : \"cursor not found\" \n}\n\n</code></pre><br>",
|
||||
"nickname": "readsNextBatchFromACursor"
|
||||
}
|
||||
],
|
||||
|
@ -94,7 +94,7 @@
|
|||
"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",
|
||||
"httpMethod": "DELETE",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/63798588\", \n \"_rev\" : \"63798588\", \n \"_key\" : \"63798588\", \n \"hello3\" : \"world1\" \n }, \n { \n \"_id\" : \"products/64126268\", \n \"_rev\" : \"64126268\", \n \"_key\" : \"64126268\", \n \"hello4\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"64650556\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 201 \n}\n\nunix> curl -X DELETE --dump - http://localhost:8529/_api/cursor/64650556\n\n</code></pre><br>",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/58313822\", \n \"_rev\" : \"58313822\", \n \"_key\" : \"58313822\", \n \"hello5\" : \"world1\" \n }, \n { \n \"_id\" : \"products/57003102\", \n \"_rev\" : \"57003102\", \n \"_key\" : \"57003102\", \n \"hello1\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"58510430\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 201 \n}\n\nunix> curl -X DELETE --dump - http://localhost:8529/_api/cursor/58510430\n\n</code></pre><br>",
|
||||
"nickname": "deletesACursor"
|
||||
}
|
||||
],
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
"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>- <em>_id</em> contains the document handle of the newly created document- <em>_key</em> contains the document key- <em>_rev</em> contains the document revision<br><br>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",
|
||||
"httpMethod": "POST",
|
||||
"examples": "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><pre><code class=\"json\" >unix> curl -X POST --data @- --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: \"292715836\"\nlocation: /_api/document/products/292715836\n\n{ \n \"error\" : false, \n \"_id\" : \"products/292715836\", \n \"_rev\" : \"292715836\", \n \"_key\" : \"292715836\" \n}\n\n</code></pre><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><pre><code class=\"json\" >unix> curl -X POST --data @- --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: \"293698876\"\nlocation: /_api/document/products/293698876\n\n{ \n \"error\" : false, \n \"_id\" : \"products/293698876\", \n \"_rev\" : \"293698876\", \n \"_key\" : \"293698876\" \n}\n\n</code></pre><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><pre><code class=\"json\" >unix> curl -X POST --data @- --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: \"294747452\"\nlocation: /_api/document/products/294747452\n\n{ \n \"error\" : false, \n \"_id\" : \"products/294747452\", \n \"_rev\" : \"294747452\", \n \"_key\" : \"294747452\" \n}\n\n</code></pre><br>Create a document in a new, named collection <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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: \"295796028\"\nlocation: /_api/document/products/295796028\n\n{ \n \"error\" : false, \n \"_id\" : \"products/295796028\", \n \"_rev\" : \"295796028\", \n \"_key\" : \"295796028\" \n}\n\n</code></pre><br>Unknown collection name: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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 /_api/collection/products not found\", \n \"code\" : 404, \n \"errorNum\" : 1203 \n}\n\n</code></pre><br>Illegal document: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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>",
|
||||
"examples": "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><pre><code class=\"json\" >unix> curl -X POST --data @- --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: \"290966622\"\nlocation: /_api/document/products/290966622\n\n{ \n \"error\" : false, \n \"_id\" : \"products/290966622\", \n \"_rev\" : \"290966622\", \n \"_key\" : \"290966622\" \n}\n\n</code></pre><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><pre><code class=\"json\" >unix> curl -X POST --data @- --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: \"292015198\"\nlocation: /_api/document/products/292015198\n\n{ \n \"error\" : false, \n \"_id\" : \"products/292015198\", \n \"_rev\" : \"292015198\", \n \"_key\" : \"292015198\" \n}\n\n</code></pre><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><pre><code class=\"json\" >unix> curl -X POST --data @- --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: \"293063774\"\nlocation: /_api/document/products/293063774\n\n{ \n \"error\" : false, \n \"_id\" : \"products/293063774\", \n \"_rev\" : \"293063774\", \n \"_key\" : \"293063774\" \n}\n\n</code></pre><br>Create a document in a new, named collection <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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: \"294112350\"\nlocation: /_api/document/products/294112350\n\n{ \n \"error\" : false, \n \"_id\" : \"products/294112350\", \n \"_rev\" : \"294112350\", \n \"_key\" : \"294112350\" \n}\n\n</code></pre><br>Unknown collection name: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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 /_api/collection/products not found\", \n \"code\" : 404, \n \"errorNum\" : 1203 \n}\n\n</code></pre><br>Illegal document: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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"
|
||||
}
|
||||
],
|
||||
|
@ -106,7 +106,7 @@
|
|||
"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",
|
||||
"httpMethod": "GET",
|
||||
"examples": "Use a document handle: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/document/products/296844604\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"296844604\"\n\n{ \n \"hello\" : \"world\", \n \"_id\" : \"products/296844604\", \n \"_rev\" : \"296844604\", \n \"_key\" : \"296844604\" \n}\n\n</code></pre><br>Use a document handle and an etag: <br><br><pre><code class=\"json\" >unix> curl --header 'If-None-Match:\"298024252\"' --dump - http://localhost:8529/_api/document/products/298024252\n\n</code></pre><br>Unknown document handle: <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>",
|
||||
"examples": "Use a document handle: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/document/products/295226462\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"295226462\"\n\n{ \n \"hello\" : \"world\", \n \"_id\" : \"products/295226462\", \n \"_rev\" : \"295226462\", \n \"_key\" : \"295226462\" \n}\n\n</code></pre><br>Use a document handle and an etag: <br><br><pre><code class=\"json\" >unix> curl --header 'If-None-Match:\"296275038\"' --dump - http://localhost:8529/_api/document/products/296275038\n\n</code></pre><br>Unknown document handle: <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"
|
||||
}
|
||||
],
|
||||
|
@ -137,7 +137,7 @@
|
|||
"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",
|
||||
"httpMethod": "GET",
|
||||
"examples": "Returns a collection. <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/299531580\", \n \"/_api/document/products/299203900\", \n \"/_api/document/products/299859260\" \n ] \n}\n\n</code></pre><br>Collection does not exist. <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 /_api/collection/doesnotexist not found\", \n \"code\" : 404, \n \"errorNum\" : 1203 \n}\n\n</code></pre><br>",
|
||||
"examples": "Returns a collection. <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/297847902\", \n \"/_api/document/products/297454686\", \n \"/_api/document/products/298175582\" \n ] \n}\n\n</code></pre><br>Collection does not exist. <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 /_api/collection/doesnotexist not found\", \n \"code\" : 404, \n \"errorNum\" : 1203 \n}\n\n</code></pre><br>",
|
||||
"nickname": "readsAllDocumentsFromCollection"
|
||||
}
|
||||
],
|
||||
|
@ -194,7 +194,7 @@
|
|||
"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",
|
||||
"httpMethod": "HEAD",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X HEAD --dump - http://localhost:8529/_api/document/products/300907836\n\n</code></pre><br>",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X HEAD --dump - http://localhost:8529/_api/document/products/299224158\n\n</code></pre><br>",
|
||||
"nickname": "readsADocumentHeader"
|
||||
}
|
||||
],
|
||||
|
@ -261,7 +261,7 @@
|
|||
"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): - specifying the target revision in the <em>rev</em> URL query parameter- specifying the target revision in the <em>if-match</em> HTTP header<br><br>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 the following request: <br><br>- PUT /_api/document/<em>document-handle</em>?rev=<em>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>- PUT /_api/document/<em>document-handle</em>?policy=<em>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": "replaces a document",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "Using document handle: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/document/products/302021948\n{\"Hello\": \"you\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"302415164\"\nlocation: /_api/document/products/302021948\n\n{ \n \"error\" : false, \n \"_id\" : \"products/302021948\", \n \"_rev\" : \"302415164\", \n \"_key\" : \"302021948\" \n}\n\n</code></pre><br>Unknown document handle: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/document/products/303398204\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/303398204 not found\", \n \"code\" : 404, \n \"errorNum\" : 1202 \n}\n\n</code></pre><br>Produce a revision conflict: <br><br><pre><code class=\"json\" >unix> curl -X PUT --header 'If-Match:\"305167676\"' --data @- --dump - http://localhost:8529/_api/document/products/304774460\n{\"other\":\"content\"}\n\nHTTP/1.1 412 Precondition Failed\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 412, \n \"errorNum\" : 1200, \n \"errorMessage\" : \"precondition failed\", \n \"_id\" : \"products/304774460\", \n \"_rev\" : \"304774460\", \n \"_key\" : \"304774460\" \n}\n\n</code></pre><br>Last write wins: <br><br><pre><code class=\"json\" >unix> curl -X PUT --header 'If-Match:\"306740540\"' --data @- --dump - http://localhost:8529/_api/document/products/306347324?policy=last\n{}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"307002684\"\nlocation: /_api/document/products/306347324\n\n{ \n \"error\" : false, \n \"_id\" : \"products/306347324\", \n \"_rev\" : \"307002684\", \n \"_key\" : \"306347324\" \n}\n\n</code></pre><br>Alternative to header field: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/document/products/307985724?rev=308378940\n{\"other\":\"content\"}\n\nHTTP/1.1 412 Precondition Failed\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 412, \n \"errorNum\" : 1200, \n \"errorMessage\" : \"precondition failed\", \n \"_id\" : \"products/307985724\", \n \"_rev\" : \"307985724\", \n \"_key\" : \"307985724\" \n}\n\n</code></pre><br>",
|
||||
"examples": "Using document handle: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/document/products/300338270\n{\"Hello\": \"you\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"300731486\"\nlocation: /_api/document/products/300338270\n\n{ \n \"error\" : false, \n \"_id\" : \"products/300338270\", \n \"_rev\" : \"300731486\", \n \"_key\" : \"300338270\" \n}\n\n</code></pre><br>Unknown document handle: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/document/products/301714526\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/301714526 not found\", \n \"code\" : 404, \n \"errorNum\" : 1202 \n}\n\n</code></pre><br>Produce a revision conflict: <br><br><pre><code class=\"json\" >unix> curl -X PUT --header 'If-Match:\"303483998\"' --data @- --dump - http://localhost:8529/_api/document/products/303090782\n{\"other\":\"content\"}\n\nHTTP/1.1 412 Precondition Failed\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 412, \n \"errorNum\" : 1200, \n \"errorMessage\" : \"precondition failed\", \n \"_id\" : \"products/303090782\", \n \"_rev\" : \"303090782\", \n \"_key\" : \"303090782\" \n}\n\n</code></pre><br>Last write wins: <br><br><pre><code class=\"json\" >unix> curl -X PUT --header 'If-Match:\"305056862\"' --data @- --dump - http://localhost:8529/_api/document/products/304663646?policy=last\n{}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"305319006\"\nlocation: /_api/document/products/304663646\n\n{ \n \"error\" : false, \n \"_id\" : \"products/304663646\", \n \"_rev\" : \"305319006\", \n \"_key\" : \"304663646\" \n}\n\n</code></pre><br>Alternative to header field: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/document/products/306302046?rev=306695262\n{\"other\":\"content\"}\n\nHTTP/1.1 412 Precondition Failed\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 412, \n \"errorNum\" : 1200, \n \"errorMessage\" : \"precondition failed\", \n \"_id\" : \"products/306302046\", \n \"_rev\" : \"306302046\", \n \"_key\" : \"306302046\" \n}\n\n</code></pre><br>",
|
||||
"nickname": "replacesADocument"
|
||||
}
|
||||
],
|
||||
|
@ -334,7 +334,7 @@
|
|||
"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",
|
||||
"httpMethod": "PATCH",
|
||||
"examples": "patches an existing document with new content. <br><br><pre><code class=\"json\" >unix> curl -X PATCH --data @- --dump - http://localhost:8529/_api/document/products/309558588\n{\"hello\":\"world\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"309951804\"\nlocation: /_api/document/products/309558588\n\n{ \n \"error\" : false, \n \"_id\" : \"products/309558588\", \n \"_rev\" : \"309951804\", \n \"_key\" : \"309558588\" \n}\n\nunix> curl -X PATCH --data @- --dump - http://localhost:8529/_api/document/products/309558588\n{\"numbers\":{\"one\":1,\"two\":2,\"three\":3,\"empty\":null}}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"310541628\"\nlocation: /_api/document/products/309558588\n\n{ \n \"error\" : false, \n \"_id\" : \"products/309558588\", \n \"_rev\" : \"310541628\", \n \"_key\" : \"309558588\" \n}\n\nunix> curl --dump - http://localhost:8529/_api/document/products/309558588\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"310541628\"\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/309558588\", \n \"_rev\" : \"310541628\", \n \"_key\" : \"309558588\" \n}\n\nunix> curl -X PATCH --data @- --dump - http://localhost:8529/_api/document/products/309558588?keepNull=false\n{\"hello\":null,\"numbers\":{\"four\":4}}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"311000380\"\nlocation: /_api/document/products/309558588\n\n{ \n \"error\" : false, \n \"_id\" : \"products/309558588\", \n \"_rev\" : \"311000380\", \n \"_key\" : \"309558588\" \n}\n\nunix> curl --dump - http://localhost:8529/_api/document/products/309558588\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"311000380\"\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/309558588\", \n \"_rev\" : \"311000380\", \n \"_key\" : \"309558588\" \n}\n\n</code></pre><br>",
|
||||
"examples": "patches an existing document with new content. <br><br><pre><code class=\"json\" >unix> curl -X PATCH --data @- --dump - http://localhost:8529/_api/document/products/307874910\n{\"hello\":\"world\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"308268126\"\nlocation: /_api/document/products/307874910\n\n{ \n \"error\" : false, \n \"_id\" : \"products/307874910\", \n \"_rev\" : \"308268126\", \n \"_key\" : \"307874910\" \n}\n\nunix> curl -X PATCH --data @- --dump - http://localhost:8529/_api/document/products/307874910\n{\"numbers\":{\"one\":1,\"two\":2,\"three\":3,\"empty\":null}}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"308857950\"\nlocation: /_api/document/products/307874910\n\n{ \n \"error\" : false, \n \"_id\" : \"products/307874910\", \n \"_rev\" : \"308857950\", \n \"_key\" : \"307874910\" \n}\n\nunix> curl --dump - http://localhost:8529/_api/document/products/307874910\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"308857950\"\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/307874910\", \n \"_rev\" : \"308857950\", \n \"_key\" : \"307874910\" \n}\n\nunix> curl -X PATCH --data @- --dump - http://localhost:8529/_api/document/products/307874910?keepNull=false\n{\"hello\":null,\"numbers\":{\"four\":4}}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"309316702\"\nlocation: /_api/document/products/307874910\n\n{ \n \"error\" : false, \n \"_id\" : \"products/307874910\", \n \"_rev\" : \"309316702\", \n \"_key\" : \"307874910\" \n}\n\nunix> curl --dump - http://localhost:8529/_api/document/products/307874910\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"309316702\"\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/307874910\", \n \"_rev\" : \"309316702\", \n \"_key\" : \"307874910\" \n}\n\n</code></pre><br>",
|
||||
"nickname": "patchesADocument"
|
||||
}
|
||||
],
|
||||
|
@ -397,7 +397,7 @@
|
|||
"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 updated document, the attribute <em>_rev</em> contains the known 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",
|
||||
"httpMethod": "DELETE",
|
||||
"examples": "Using document handle: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/document/products/312114492\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : false, \n \"_id\" : \"products/312114492\", \n \"_rev\" : \"312114492\", \n \"_key\" : \"312114492\" \n}\n\n</code></pre><br>Unknown document handle: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/document/products/313294140\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/313294140 not found\", \n \"code\" : 404, \n \"errorNum\" : 1202 \n}\n\n</code></pre><br>Revision conflict: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --header 'If-Match:\"315063612\"' --dump - http://localhost:8529/_api/document/products/314670396\n\nHTTP/1.1 412 Precondition Failed\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 412, \n \"errorNum\" : 1200, \n \"errorMessage\" : \"precondition failed\", \n \"_id\" : \"products/314670396\", \n \"_rev\" : \"314670396\", \n \"_key\" : \"314670396\" \n}\n\n</code></pre><br>",
|
||||
"examples": "Using document handle: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/document/products/310430814\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : false, \n \"_id\" : \"products/310430814\", \n \"_rev\" : \"310430814\", \n \"_key\" : \"310430814\" \n}\n\n</code></pre><br>Unknown document handle: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/document/products/311675998\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/311675998 not found\", \n \"code\" : 404, \n \"errorNum\" : 1202 \n}\n\n</code></pre><br>Revision conflict: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --header 'If-Match:\"313379934\"' --dump - http://localhost:8529/_api/document/products/312986718\n\nHTTP/1.1 412 Precondition Failed\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 412, \n \"errorNum\" : 1200, \n \"errorMessage\" : \"precondition failed\", \n \"_id\" : \"products/312986718\", \n \"_rev\" : \"312986718\", \n \"_key\" : \"312986718\" \n}\n\n</code></pre><br>",
|
||||
"nickname": "deletesADocument"
|
||||
}
|
||||
],
|
||||
|
|
|
@ -46,10 +46,10 @@
|
|||
"description": "A JSON representation of the edge document must be passed as the body of the POST request. This JSON object may contain the edge's document key in the <em>_key</em> attribute if needed. "
|
||||
}
|
||||
],
|
||||
"notes": "<em>from</em> handle and <em>to</em> handle are immutable once the edge has been created. <br><br>In all other respects the method works like <em>POST /document</em>, see @ref RestDocument for details. <br><br>",
|
||||
"notes": "<em>from</em> handle and <em>to</em> handle 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",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Create an edge and reads it back: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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: \"318209340\"\nlocation: /_api/document/edges/318209340\n\n{ \n \"error\" : false, \n \"_id\" : \"edges/318209340\", \n \"_rev\" : \"318209340\", \n \"_key\" : \"318209340\" \n}\n\nunix> curl --dump - http://localhost:8529/_api/edge/edges/318209340\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"318209340\"\n\n{ \n \"name\" : \"Emil\", \n \"_id\" : \"edges/318209340\", \n \"_rev\" : \"318209340\", \n \"_key\" : \"318209340\", \n \"_from\" : \"vertices/1\", \n \"_to\" : \"vertices/2\" \n}\n\n</code></pre><br>",
|
||||
"examples": "Create an edge and reads it back: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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: \"316525662\"\nlocation: /_api/document/edges/316525662\n\n{ \n \"error\" : false, \n \"_id\" : \"edges/316525662\", \n \"_rev\" : \"316525662\", \n \"_key\" : \"316525662\" \n}\n\nunix> curl --dump - http://localhost:8529/_api/edge/edges/316525662\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"316525662\"\n\n{ \n \"name\" : \"Emil\", \n \"_id\" : \"edges/316525662\", \n \"_rev\" : \"316525662\", \n \"_key\" : \"316525662\", \n \"_from\" : \"vertices/1\", \n \"_to\" : \"vertices/2\" \n}\n\n</code></pre><br>",
|
||||
"nickname": "createsAnEdge"
|
||||
}
|
||||
],
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
"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",
|
||||
"httpMethod": "GET",
|
||||
"examples": "Any direction <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\" : \"69369148\", \n \"_key\" : \"6\", \n \"_from\" : \"vertices/2\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v2 -> v1\" \n }, \n { \n \"_id\" : \"edges/7\", \n \"_rev\" : \"69958972\", \n \"_key\" : \"7\", \n \"_from\" : \"vertices/4\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v4 -> v1\" \n }, \n { \n \"_id\" : \"edges/5\", \n \"_rev\" : \"68779324\", \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>In edges <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\" : \"74874172\", \n \"_key\" : \"6\", \n \"_from\" : \"vertices/2\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v2 -> v1\" \n }, \n { \n \"_id\" : \"edges/7\", \n \"_rev\" : \"75463996\", \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>Out edges <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\" : \"79789372\", \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>",
|
||||
"examples": "Any direction <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\" : \"63229022\", \n \"_key\" : \"6\", \n \"_from\" : \"vertices/2\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v2 -> v1\" \n }, \n { \n \"_id\" : \"edges/7\", \n \"_rev\" : \"63818846\", \n \"_key\" : \"7\", \n \"_from\" : \"vertices/4\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v4 -> v1\" \n }, \n { \n \"_id\" : \"edges/5\", \n \"_rev\" : \"62639198\", \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>In edges <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\" : \"68734046\", \n \"_key\" : \"6\", \n \"_from\" : \"vertices/2\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v2 -> v1\" \n }, \n { \n \"_id\" : \"edges/7\", \n \"_rev\" : \"69323870\", \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>Out edges <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\" : \"73649246\", \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"
|
||||
}
|
||||
],
|
||||
|
|
|
@ -38,7 +38,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><pre><code class=\"json\" >unix> curl -X POST --data @- --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: 85359932\n\n{ \n \"graph\" : { \n \"_id\" : \"_graphs/graph\", \n \"_rev\" : \"85359932\", \n \"_key\" : \"graph\", \n \"edges\" : \"edges\", \n \"vertices\" : \"vertices\" \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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: 79285342\n\n{ \n \"graph\" : { \n \"_id\" : \"_graphs/graph\", \n \"_rev\" : \"79285342\", \n \"_key\" : \"graph\", \n \"edges\" : \"edges\", \n \"vertices\" : \"vertices\" \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "createGraph"
|
||||
}
|
||||
],
|
||||
|
@ -49,19 +49,19 @@
|
|||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the graph was found ",
|
||||
"reason": "is returned if the graph was found (in case <em>graph-name</em> was specified) or the list of graphs was assembled successfully (in case <em>graph-name</em> was not specified). ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the graph was not found. The response body contains an error document in this case. ",
|
||||
"reason": "is returned if the graph was not found. This response code may only be returned if <em>graph-name</em> is specified in the request. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
},
|
||||
{
|
||||
"reason": "\"If-None-Match\" header is given and the current graph has not a different version ",
|
||||
"reason": "\"If-None-Match\" header is given and the current graph has not a different version. This response code may only be returned if <em>graph-name</em> is specified in the request. ",
|
||||
"code": "304"
|
||||
},
|
||||
{
|
||||
"reason": "\"If-Match\" header or <em>rev</em> is given and the current graph has a different version ",
|
||||
"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. ",
|
||||
"code": "412"
|
||||
}
|
||||
],
|
||||
|
@ -69,28 +69,28 @@
|
|||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"required": "false",
|
||||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
"description": "The name of the graph. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "If-None-Match",
|
||||
"description": "If the \"If-None-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has a different revision than the given etag. Otherwise a <em>HTTP 304</em> is returned. "
|
||||
"description": "If <em>graph-name</em> is specified, then this header can be used to check whether a specific graph has changed or not. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "If-Match",
|
||||
"description": "If the \"If-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has the same revision ad the given etag. Otherwise a <em>HTTP 412</em> is returned. As an alternative you can supply the etag in an attribute <em>rev</em> in the URL. "
|
||||
"description": "If <em>graph-name</em> is specified, then this header can be used to check whether a specific graph has changed or not. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Returns an object with an attribute <em>graph</em> containing a list of all graph properties. <br><br>",
|
||||
"summary": "get graph properties",
|
||||
"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": "get graph by name <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: 87457084\n\n{ \n \"graph\" : { \n \"_id\" : \"_graphs/graph\", \n \"_rev\" : \"87457084\", \n \"_key\" : \"graph\", \n \"edges\" : \"edges\", \n \"vertices\" : \"vertices\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "getGraphProperties"
|
||||
"examples": "get graph by name <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: 81316958\n\n{ \n \"graph\" : { \n \"_id\" : \"_graphs/graph\", \n \"_rev\" : \"81316958\", \n \"_key\" : \"graph\", \n \"edges\" : \"edges\", \n \"vertices\" : \"vertices\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>get all graphs <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/graph2\", \n \"_rev\" : \"85576798\", \n \"_key\" : \"graph2\", \n \"edges\" : \"edges2\", \n \"vertices\" : \"vertices2\" \n }, \n { \n \"_id\" : \"_graphs/graph1\", \n \"_rev\" : \"83479646\", \n \"_key\" : \"graph1\", \n \"edges\" : \"edges1\", \n \"vertices\" : \"vertices1\" \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "getThePropertiesOfASpecificOrAllGraphs"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph/{graph-name}"
|
||||
|
@ -178,7 +178,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><pre><code class=\"json\" >unix> curl -X POST --data @- --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: 92503356\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"92503356\", \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\" >unix> curl -X POST --data @- --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: 90819678\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"90819678\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
|
||||
"nickname": "createVertex"
|
||||
}
|
||||
],
|
||||
|
@ -235,7 +235,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": "get vertex properties by name <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: 95124796\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"95124796\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"examples": "get vertex properties by name <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: 93375582\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"93375582\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "getVertex"
|
||||
}
|
||||
],
|
||||
|
@ -356,7 +356,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><pre><code class=\"json\" >unix> curl -X PUT --data @- --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: 101481788\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"101481788\", \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\" >unix> curl -X PUT --data @- --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: 99798110\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"99798110\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val2\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
|
||||
"nickname": "updateVertex"
|
||||
}
|
||||
],
|
||||
|
@ -426,7 +426,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>. 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><pre><code class=\"json\" >unix> curl -X PATCH --data @- --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: 104627516\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"104627516\", \n \"_key\" : \"v1\", \n \"optional1\" : \"vertexPatch\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\nunix> curl -X PATCH --data @- --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: 105151804\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"105151804\", \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\" >unix> curl -X PATCH --data @- --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: 102943838\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"102943838\", \n \"_key\" : \"v1\", \n \"optional1\" : \"vertexPatch\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\nunix> curl -X PATCH --data @- --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: 103468126\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"103468126\", \n \"_key\" : \"v1\", \n \"optional1\" : null \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
|
||||
"nickname": "updateVertex"
|
||||
}
|
||||
],
|
||||
|
@ -460,7 +460,7 @@
|
|||
"notes": "Returns a cursor. <br><br>The call expects a JSON hash array as body to filter the result: <br><br>- <em>batchSize</em>: the batch size of the returned cursor- <em>limit</em>: limit the result size- <em>count</em>: return the total number of results (default \"false\")- <em>filter</em>: a optional filter<br><br>The attributes of filter - <em>properties</em>: filter by an array of vertex properties<br><br>The attributes of a property filter - <em>key</em>: filter the result vertices by a key value pair- <em>value</em>: the value of the <em>key</em>- <em>compare</em>: a compare operator<br><br>",
|
||||
"summary": "get vertices",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Select all vertices <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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\" : \"109083964\", \n \"_key\" : \"v5\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v4\", \n \"_rev\" : \"108756284\", \n \"_key\" : \"v4\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"107707708\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v3\", \n \"_rev\" : \"108428604\", \n \"_key\" : \"v3\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v2\", \n \"_rev\" : \"108100924\", \n \"_key\" : \"v2\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"examples": "Select all vertices <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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\" : \"107400286\", \n \"_key\" : \"v5\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v4\", \n \"_rev\" : \"107072606\", \n \"_key\" : \"v4\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"106089566\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v3\", \n \"_rev\" : \"106744926\", \n \"_key\" : \"v3\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v2\", \n \"_rev\" : \"106417246\", \n \"_key\" : \"v2\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "getVertices"
|
||||
}
|
||||
],
|
||||
|
@ -494,7 +494,7 @@
|
|||
"notes": "Returns a cursor. <br><br>The call expects a JSON hash array as body to filter the result: <br><br>- <em>batchSize</em>: the batch size of the returned cursor- <em>limit</em>: limit the result size- <em>count</em>: return the total number of results (default \"false\")- <em>filter</em>: a optional filter<br><br>The attributes of filter - <em>direction</em>: Filter for inbound (value \"in\") or outbound (value \"out\") neighbors. Default value is \"any\". - <em>labels</em>: filter by an array of edge labels (empty array means no restriction)- <em>properties</em>: filter neighbors by an array of edge properties<br><br>The attributes of a property filter - <em>key</em>: filter the result vertices by a key value pair- <em>value</em>: the value of the <em>key</em>- <em>compare</em>: a compare operator<br><br>",
|
||||
"summary": "get vertices",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Select all vertices <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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\" : \"111770940\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v4\", \n \"_rev\" : \"112819516\", \n \"_key\" : \"v4\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Select vertices by direction and property filter <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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\" : \"119700796\", \n \"_key\" : \"v4\", \n \"optional1\" : \"val2\" \n }, \n { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"118652220\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"examples": "Select all vertices <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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\" : \"110087262\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v4\", \n \"_rev\" : \"111135838\", \n \"_key\" : \"v4\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Select vertices by direction and property filter <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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\" : \"118017118\", \n \"_key\" : \"v4\", \n \"optional1\" : \"val2\" \n }, \n { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"116968542\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "getVertices"
|
||||
}
|
||||
],
|
||||
|
@ -538,7 +538,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>- <em>_key</em>: The name of the edge.- <em>_from</em>: The name of the from vertex.- <em>_to</em>: The name of the to vertex.- <em>$label</em>: A label for the edge (optional).- further optional attributes.<br><br>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><pre><code class=\"json\" >unix> curl -X POST --data @- --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: 126647612\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"126647612\", \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\" >unix> curl -X POST --data @- --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: 124963934\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"124963934\", \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>",
|
||||
"nickname": "createEdge"
|
||||
}
|
||||
],
|
||||
|
@ -595,7 +595,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><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: 130317628\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"130317628\", \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\" >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: 128633950\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"128633950\", \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>",
|
||||
"nickname": "getEdge"
|
||||
}
|
||||
],
|
||||
|
@ -716,7 +716,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><pre><code class=\"json\" >unix> curl -X PUT --data @- --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: 138706236\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"138706236\", \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\" >unix> curl -X PUT --data @- --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: 137022558\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"137022558\", \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>",
|
||||
"nickname": "updateEdge"
|
||||
}
|
||||
],
|
||||
|
@ -786,7 +786,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><pre><code class=\"json\" >unix> curl -X PATCH --data @- --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: 142966076\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"142966076\", \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\" >unix> curl -X PATCH --data @- --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: 141282398\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"141282398\", \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>",
|
||||
"nickname": "updateEdge"
|
||||
}
|
||||
],
|
||||
|
@ -820,7 +820,7 @@
|
|||
"notes": "Returns a cursor. <br><br>The call expects a JSON hash array as body to filter the result: <br><br>- <em>batchSize</em>: the batch size of the returned cursor- <em>limit</em>: limit the result size- <em>count</em>: return the total number of results (default \"false\")- <em>filter</em>: a optional filter<br><br>The attributes of filter - <em>labels</em>: filter by an array of edge labels- <em>properties</em>: filter by an array of edge properties<br><br>The attributes of a property filter - <em>key</em>: filter the result edges by a key value pair- <em>value</em>: the value of the <em>key</em>- <em>compare</em>: a compare operator<br><br>",
|
||||
"summary": "get edges",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Select all edges <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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\" : \"149454140\", \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\" : \"147684668\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v2\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge2\", \n \"_rev\" : \"148274492\", \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\" : \"148864316\", \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": "Select all edges <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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\" : \"147770462\", \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\" : \"146000990\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v2\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge2\", \n \"_rev\" : \"146590814\", \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\" : \"147180638\", \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>",
|
||||
"nickname": "getEdges"
|
||||
}
|
||||
],
|
||||
|
@ -861,7 +861,7 @@
|
|||
"notes": "<br><br>Returns a cursor. <br><br>The call expects a JSON hash array as body to filter the result: <br><br>- <em>batchSize</em>: the batch size of the returned cursor- <em>limit</em>: limit the result size- <em>count</em>: return the total number of results (default \"false\")- <em>filter</em>: a optional filter<br><br>The attributes of filter - <em>direction</em>: Filter for inbound (value \"in\") or outbound (value \"out\") neighbors. Default value is \"any\". - <em>labels</em>: filter by an array of edge labels- <em>properties</em>: filter neighbors by an array of properties<br><br>The attributes of a property filter - <em>key</em>: filter the result vertices by a key value pair- <em>value</em>: the value of the <em>key</em>- <em>compare</em>: a compare operator<br><br>",
|
||||
"summary": "get edges",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Select all edges <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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\" : \"154303804\", \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\" : \"155483452\", \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": "Select all edges <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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\" : \"152620126\", \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\" : \"153799774\", \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>",
|
||||
"nickname": "getEdges"
|
||||
}
|
||||
],
|
||||
|
|
|
@ -89,10 +89,10 @@
|
|||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Creates a cap constraint (@ref IndexCapIntro) for the collection <em>collection-name</em>, if it does not already exist. Expects an object containing the index details. <br><br>- <em>type</em>: must be equal to <em>\"cap\"</em>.<br><br>- <em>size</em>: The maximal number of documents for the collection.<br><br>- <em>byteSize</em>: The maximal size of the active document data in the collection.<br><br>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>",
|
||||
"notes": "<br><br>Creates a cap constraint (the manual) for the collection <em>collection-name</em>, if it does not already exist. Expects an object containing the index details. <br><br>- <em>type</em>: must be equal to <em>\"cap\"</em>.<br><br>- <em>size</em>: The maximal number of documents for the collection.<br><br>- <em>byteSize</em>: The maximal size of the active document data in the collection.<br><br>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",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Creating a cap constraint <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/158891324\", \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>",
|
||||
"examples": "Creating a cap constraint <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/157207646\", \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"
|
||||
}
|
||||
],
|
||||
|
@ -134,7 +134,7 @@
|
|||
"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>- <em>type</em>: must be equal to <em>\"geo\"</em>.<br><br>- <em>fields</em>: A list with one or two attribute paths. <br><br> 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. <br><br> 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. <br><br>- <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 <br><br>- <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. <br><br>- <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. <br><br>",
|
||||
"summary": "creates a geo-spatial index",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Creating a geo index with a location attribute: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/159743292\", \n \"type\" : \"geo1\", \n \"unique\" : false, \n \"geoJson\" : false, \n \"constraint\" : false, \n \"fields\" : [ \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Creating a geo index with latitude and longitude attributes: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/160595260\", \n \"type\" : \"geo2\", \n \"unique\" : false, \n \"constraint\" : false, \n \"fields\" : [ \n \"e\", \n \"f\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"examples": "Creating a geo index with a location attribute: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/158059614\", \n \"type\" : \"geo1\", \n \"unique\" : false, \n \"geoJson\" : false, \n \"constraint\" : false, \n \"fields\" : [ \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Creating a geo index with latitude and longitude attributes: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/158911582\", \n \"type\" : \"geo2\", \n \"unique\" : false, \n \"constraint\" : 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"
|
||||
}
|
||||
],
|
||||
|
@ -180,7 +180,7 @@
|
|||
"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>- <em>type</em>: must be equal to <em>\"hash\"</em>.<br><br>- <em>fields</em>: A list of attribute paths.<br><br>- <em>unique</em>: If <em>true</em>, then create a unique index.<br><br>",
|
||||
"summary": "creates a hash index",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Creating an unique constraint: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/161512764\", \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>Creating a hash index: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/162364732\", \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>",
|
||||
"examples": "Creating an unique constraint: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/159829086\", \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>Creating a hash index: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/160681054\", \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"
|
||||
}
|
||||
],
|
||||
|
@ -226,7 +226,7 @@
|
|||
"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>- <em>type</em>: must be equal to <em>\"skiplist\"</em>.<br><br>- <em>fields</em>: A list of attribute paths.<br><br>- <em>unique</em>: If <em>true</em>, then create a unique index.<br><br>",
|
||||
"summary": "creates a skip list",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Creating a skiplist: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/163282236\", \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>",
|
||||
"examples": "Creating a skiplist: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/161598558\", \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"
|
||||
}
|
||||
],
|
||||
|
@ -268,7 +268,7 @@
|
|||
"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>- <em>type</em>: must be equal to <em>\"fulltext\"</em>.<br><br>- <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>. <br><br>- <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. <br><br>",
|
||||
"summary": "creates a fulltext index",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Creating a fulltext index: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/164068668\", \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>",
|
||||
"examples": "Creating a fulltext index: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/162384990\", \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"
|
||||
}
|
||||
],
|
||||
|
@ -310,7 +310,7 @@
|
|||
"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>- <em>type</em>: must be equal to <em>\"bitarray\"</em>.<br><br>- <em>fields</em>: A list of pairs. A pair consists of an attribute path followed by a list of values.<br><br>- <em>unique</em>: Must always be set to <em>false</em>.<br><br>",
|
||||
"summary": "creates a bitarray index",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Creating a bitarray index: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/164986172\", \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>",
|
||||
"examples": "Creating a bitarray index: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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/163302494\", \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"
|
||||
}
|
||||
],
|
||||
|
@ -345,7 +345,7 @@
|
|||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Creates a new index in the collection <em>collection-name</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 @ref IndexCapHttp, @ref IndexGeoHttp, @ref IndexHashHttp, @ref IndexFulltextHttp, and @ref IndexSkiplistHttp 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: - cap constraints- fulltext indexes<br><br>",
|
||||
"notes": "<br><br>Creates a new index in the collection <em>collection-name</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: - cap constraints- fulltext indexes<br><br>",
|
||||
"summary": "creates an index",
|
||||
"httpMethod": "POST",
|
||||
"examples": "",
|
||||
|
@ -375,7 +375,7 @@
|
|||
"notes": "<br><br>Deletes an index with <em>index-handle</em>. <br><br>",
|
||||
"summary": "deletes an index",
|
||||
"httpMethod": "DELETE",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/index/products/165838140\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/165838140\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/index/products/164154462\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/164154462\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "deletesAnIndex"
|
||||
}
|
||||
],
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
"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",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Valid query: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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>Invalid query: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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\n</code></pre><br>",
|
||||
"examples": "Valid query: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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>Invalid query: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --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"
|
||||
}
|
||||
],
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -29,10 +29,10 @@
|
|||
"description": "Contains the query. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Returns all documents of a collections. The call expects a JSON object as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>skip</em>: The number of documents to skip in the query (optional).<br><br>- <em>limit</em>: The maximal amount of documents to return. The <em>skip</em> is applied before the <em>limit</em> restriction. (optional) <br><br>Returns a cursor containing the result, see @ref HttpCursor for details. <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>- <em>collection</em>: The name of the collection to query.<br><br>- <em>skip</em>: The number of documents to skip in the query (optional).<br><br>- <em>limit</em>: The maximal amount of documents to return. The <em>skip</em> is applied before the <em>limit</em> restriction. (optional) <br><br>Returns a cursor containing the result, see the manual for details. <br><br>",
|
||||
"summary": "executes simple query ALL",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "Limit the amount of documents using <em>limit</em> <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/168197436\", \n \"_rev\" : \"168197436\", \n \"_key\" : \"168197436\", \n \"Hello5\" : \"World5\" \n }, \n { \n \"_id\" : \"products/167869756\", \n \"_rev\" : \"167869756\", \n \"_key\" : \"167869756\", \n \"Hello4\" : \"World4\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Using a <em>batchSize</em> value <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/170032444\", \n \"_rev\" : \"170032444\", \n \"_key\" : \"170032444\", \n \"Hello3\" : \"World3\" \n }, \n { \n \"_id\" : \"products/169704764\", \n \"_rev\" : \"169704764\", \n \"_key\" : \"169704764\", \n \"Hello2\" : \"World2\" \n }, \n { \n \"_id\" : \"products/170687804\", \n \"_rev\" : \"170687804\", \n \"_key\" : \"170687804\", \n \"Hello5\" : \"World5\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"170884412\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"examples": "Limit the amount of documents using <em>limit</em> <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/165137502\", \n \"_rev\" : \"165137502\", \n \"_key\" : \"165137502\", \n \"Hello1\" : \"World1\" \n }, \n { \n \"_id\" : \"products/166186078\", \n \"_rev\" : \"166186078\", \n \"_key\" : \"166186078\", \n \"Hello4\" : \"World4\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Using a <em>batchSize</em> value <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/169004126\", \n \"_rev\" : \"169004126\", \n \"_key\" : \"169004126\", \n \"Hello5\" : \"World5\" \n }, \n { \n \"_id\" : \"products/167627870\", \n \"_rev\" : \"167627870\", \n \"_key\" : \"167627870\", \n \"Hello1\" : \"World1\" \n }, \n { \n \"_id\" : \"products/168348766\", \n \"_rev\" : \"168348766\", \n \"_key\" : \"168348766\", \n \"Hello3\" : \"World3\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"169200734\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "executesSimpleQueryAll"
|
||||
}
|
||||
],
|
||||
|
@ -67,7 +67,7 @@
|
|||
"notes": "<br><br>Returns a random document of a collection. The call expects a JSON object as body with the following attributes: <br><br>- <em>collection</em>: The identifier or name of the collection to query.<br><br>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 attrbute contains null. <br><br>",
|
||||
"summary": "executes simple query ANY",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/172522812\", \n \"_rev\" : \"172522812\", \n \"_key\" : \"172522812\", \n \"Hello3\" : \"World3\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/171494494\", \n \"_rev\" : \"171494494\", \n \"_key\" : \"171494494\", \n \"Hello5\" : \"World5\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "executesSimpleQueryAny"
|
||||
}
|
||||
],
|
||||
|
@ -99,10 +99,10 @@
|
|||
"description": "Contains the query. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>The default will find at most 100 documents near a given coordinate. The returned list is sorted according to the distance, with the nearest document coming first. 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 hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>latitude</em>: The latitude of the coordinate.<br><br>- <em>longitude</em>: The longitude of the coordinate.<br><br>- <em>distance</em>: If given, the attribute key used to store the distance. (optional) <br><br>- <em>skip</em>: The number of documents to skip in the query. (optional)<br><br>- <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) <br><br>- <em>geo</em>: If given, the identifier of the geo-index to use. (optional)<br><br>Returns a cursor containing the result, see @ref HttpCursor for details. <br><br>",
|
||||
"notes": "<br><br>The default will find at most 100 documents near a given coordinate. The returned list is sorted according to the distance, with the nearest document coming first. 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 hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>latitude</em>: The latitude of the coordinate.<br><br>- <em>longitude</em>: The longitude of the coordinate.<br><br>- <em>distance</em>: If given, the attribute key used to store the distance. (optional) <br><br>- <em>skip</em>: The number of documents to skip in the query. (optional)<br><br>- <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) <br><br>- <em>geo</em>: If given, the identifier of the geo-index to use. (optional)<br><br>Returns a cursor containing the result, see the manual for details. <br><br>",
|
||||
"summary": "executes simple query NEAR",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "Without distance: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/175668540\", \n \"_rev\" : \"175668540\", \n \"_key\" : \"175668540\", \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/175275324\", \n \"_rev\" : \"175275324\", \n \"_key\" : \"175275324\", \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>With distance: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/178683196\", \n \"_rev\" : \"178683196\", \n \"_key\" : \"178683196\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/179076412\", \n \"_rev\" : \"179076412\", \n \"_key\" : \"179076412\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/178486588\", \n \"_rev\" : \"178486588\", \n \"_key\" : \"178486588\", \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>",
|
||||
"examples": "Without distance: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/173984862\", \n \"_rev\" : \"173984862\", \n \"_key\" : \"173984862\", \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/173591646\", \n \"_rev\" : \"173591646\", \n \"_key\" : \"173591646\", \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>With distance: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/176999518\", \n \"_rev\" : \"176999518\", \n \"_key\" : \"176999518\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/177392734\", \n \"_rev\" : \"177392734\", \n \"_key\" : \"177392734\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/176802910\", \n \"_rev\" : \"176802910\", \n \"_key\" : \"176802910\", \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": "executesSimpleQueryNear"
|
||||
}
|
||||
],
|
||||
|
@ -134,10 +134,10 @@
|
|||
"description": "Contains the query. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>This will find all documents with in 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 hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>latitude</em>: The latitude of the coordinate.<br><br>- <em>longitude</em>: The longitude of the coordinate.<br><br>- <em>radius</em>: The maximal radius (in meters).<br><br>- <em>distance</em>: If given, the result attribute key used to store the distance values (optional). If specified, distances are returned in meters. <br><br>- <em>skip</em>: The documents to skip in the query. (optional)<br><br>- <em>limit</em>: The maximal amount of documents to return. (optional)<br><br>- <em>geo</em>: If given, the identifier of the geo-index to use. (optional)<br><br>Returns a cursor containing the result, see @ref HttpCursor for details. <br><br>",
|
||||
"notes": "<br><br>This will find all documents with in 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 hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>latitude</em>: The latitude of the coordinate.<br><br>- <em>longitude</em>: The longitude of the coordinate.<br><br>- <em>radius</em>: The maximal radius (in meters).<br><br>- <em>distance</em>: If given, the result attribute key used to store the distance values (optional). If specified, distances are returned in meters. <br><br>- <em>skip</em>: The documents to skip in the query. (optional)<br><br>- <em>limit</em>: The maximal amount of documents to return. (optional)<br><br>- <em>geo</em>: If given, the identifier of the geo-index to use. (optional)<br><br>Returns a cursor containing the result, see the manual for details. <br><br>",
|
||||
"summary": "executes simple query WITHIN",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "Without distance: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/182484284\", \n \"_rev\" : \"182484284\", \n \"_key\" : \"182484284\", \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/182091068\", \n \"_rev\" : \"182091068\", \n \"_key\" : \"182091068\", \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>With distance: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/185498940\", \n \"_rev\" : \"185498940\", \n \"_key\" : \"185498940\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/185892156\", \n \"_rev\" : \"185892156\", \n \"_key\" : \"185892156\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/185302332\", \n \"_rev\" : \"185302332\", \n \"_key\" : \"185302332\", \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>",
|
||||
"examples": "Without distance: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/180800606\", \n \"_rev\" : \"180800606\", \n \"_key\" : \"180800606\", \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/180407390\", \n \"_rev\" : \"180407390\", \n \"_key\" : \"180407390\", \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>With distance: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/183815262\", \n \"_rev\" : \"183815262\", \n \"_key\" : \"183815262\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/184208478\", \n \"_rev\" : \"184208478\", \n \"_key\" : \"184208478\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/183618654\", \n \"_rev\" : \"183618654\", \n \"_key\" : \"183618654\", \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": "executesSimpleQueryWithin"
|
||||
}
|
||||
],
|
||||
|
@ -169,10 +169,10 @@
|
|||
"description": "Contains the 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 hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>attribute</em>: The attribute that contains the texts.<br><br>- <em>query</em>: The fulltext query.<br><br>- <em>skip</em>: The documents to skip in the query. (optional)<br><br>- <em>limit</em>: The maximal amount of documents to return. (optional)<br><br>- <em>index</em>: If given, the identifier of the fulltext-index to use. (optional)<br><br>Returns a cursor containing the result, see @ref HttpCursor for details. <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 hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>attribute</em>: The attribute that contains the texts.<br><br>- <em>query</em>: The fulltext query.<br><br>- <em>skip</em>: The documents to skip in the query. (optional)<br><br>- <em>limit</em>: The maximal amount of documents to return. (optional)<br><br>- <em>index</em>: If given, the identifier of the fulltext-index to use. (optional)<br><br>Returns a cursor containing the result, see the manual for details. <br><br>",
|
||||
"summary": "executes simple query FULLTEXT",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/188120380\", \n \"_rev\" : \"188120380\", \n \"_key\" : \"188120380\", \n \"text\" : \"this text also has a word\" \n }, \n { \n \"_id\" : \"products/187923772\", \n \"_rev\" : \"187923772\", \n \"_key\" : \"187923772\", \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>",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/186436702\", \n \"_rev\" : \"186436702\", \n \"_key\" : \"186436702\", \n \"text\" : \"this text also has a word\" \n }, \n { \n \"_id\" : \"products/186240094\", \n \"_rev\" : \"186240094\", \n \"_key\" : \"186240094\", \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": "executesSimpleQueryFulltext"
|
||||
}
|
||||
],
|
||||
|
@ -204,10 +204,10 @@
|
|||
"description": "Contains the query. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>This will find all documents matching a given example. <br><br>The call expects a JSON hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>example</em>: The example.<br><br>- <em>skip</em>: The documents to skip in the query. (optional)<br><br>- <em>limit</em>: The maximal amount of documents to return. (optional)<br><br>Returns a cursor containing the result, see @ref HttpCursor for details. <br><br>",
|
||||
"notes": "<br><br>This will find all documents matching a given example. <br><br>The call expects a JSON hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>example</em>: The example.<br><br>- <em>skip</em>: The documents to skip in the query. (optional)<br><br>- <em>limit</em>: The maximal amount of documents to return. (optional)<br><br>Returns a cursor containing the result, see the manual for details. <br><br>",
|
||||
"summary": "executes simple query by-example",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "Matching an attribute: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/189889852\", \n \"_rev\" : \"189889852\", \n \"_key\" : \"189889852\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/190479676\", \n \"_rev\" : \"190479676\", \n \"_key\" : \"190479676\", \n \"i\" : 1 \n }, \n { \n \"_id\" : \"products/190676284\", \n \"_rev\" : \"190676284\", \n \"_key\" : \"190676284\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 2, \n \"j\" : 2 \n } \n }, \n { \n \"_id\" : \"products/190217532\", \n \"_rev\" : \"190217532\", \n \"_key\" : \"190217532\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n } \n ], \n \"hasMore\" : false, \n \"count\" : 4, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Matching an attribute which is a sub-document: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/192445756\", \n \"_rev\" : \"192445756\", \n \"_key\" : \"192445756\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/192118076\", \n \"_rev\" : \"192118076\", \n \"_key\" : \"192118076\", \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>Matching an attribute within a sub-document: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/194673980\", \n \"_rev\" : \"194673980\", \n \"_key\" : \"194673980\", \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>",
|
||||
"examples": "Matching an attribute: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/188533854\", \n \"_rev\" : \"188533854\", \n \"_key\" : \"188533854\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/188992606\", \n \"_rev\" : \"188992606\", \n \"_key\" : \"188992606\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 2, \n \"j\" : 2 \n } \n }, \n { \n \"_id\" : \"products/188206174\", \n \"_rev\" : \"188206174\", \n \"_key\" : \"188206174\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/188795998\", \n \"_rev\" : \"188795998\", \n \"_key\" : \"188795998\", \n \"i\" : 1 \n } \n ], \n \"hasMore\" : false, \n \"count\" : 4, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Matching an attribute which is a sub-document: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/190762078\", \n \"_rev\" : \"190762078\", \n \"_key\" : \"190762078\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/190434398\", \n \"_rev\" : \"190434398\", \n \"_key\" : \"190434398\", \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>Matching an attribute within a sub-document: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/192990302\", \n \"_rev\" : \"192990302\", \n \"_key\" : \"192990302\", \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"
|
||||
}
|
||||
],
|
||||
|
@ -234,7 +234,7 @@
|
|||
"notes": "<br><br>This will return the first document matching a given example. <br><br>The call expects a JSON hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>example</em>: The example.<br><br>Returns a result containing the document or <em>HTTP 404</em> if no document matched the example. <br><br>",
|
||||
"summary": "executes simple query first-example",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "If a matching document was found: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/197164348\", \n \"_rev\" : \"197164348\", \n \"_key\" : \"197164348\", \n \"i\" : 1 \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>If no document was found: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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>",
|
||||
"examples": "If a matching document was found: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/194890846\", \n \"_rev\" : \"194890846\", \n \"_key\" : \"194890846\", \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>If no document was found: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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": "executesSimpleQueryFirst-example"
|
||||
}
|
||||
],
|
||||
|
@ -269,7 +269,7 @@
|
|||
"notes": "<br><br>This will return the first 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 \"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>",
|
||||
"summary": "executes simple query first",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "Retrieving the first n documents: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/200899900\", \n \"_rev\" : \"200899900\", \n \"_key\" : \"200899900\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/201293116\", \n \"_rev\" : \"201293116\", \n \"_key\" : \"201293116\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Retrieving the first document: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/203062588\", \n \"_rev\" : \"203062588\", \n \"_key\" : \"203062588\", \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>",
|
||||
"examples": "Retrieving the first n documents: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/199216222\", \n \"_rev\" : \"199216222\", \n \"_key\" : \"199216222\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/199609438\", \n \"_rev\" : \"199609438\", \n \"_key\" : \"199609438\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Retrieving the first document: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/201378910\", \n \"_rev\" : \"201378910\", \n \"_key\" : \"201378910\", \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": "executesSimpleQueryFirst"
|
||||
}
|
||||
],
|
||||
|
@ -304,7 +304,7 @@
|
|||
"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. 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>",
|
||||
"summary": "executes simple query last",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "Retrieving the last n documents: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/206077244\", \n \"_rev\" : \"206077244\", \n \"_key\" : \"206077244\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 2, \n \"j\" : 2 \n } \n }, \n { \n \"_id\" : \"products/205880636\", \n \"_rev\" : \"205880636\", \n \"_key\" : \"205880636\", \n \"i\" : 1 \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Retrieving the first document: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/208239932\", \n \"_rev\" : \"208239932\", \n \"_key\" : \"208239932\", \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>",
|
||||
"examples": "Retrieving the last n documents: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/204393566\", \n \"_rev\" : \"204393566\", \n \"_key\" : \"204393566\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 2, \n \"j\" : 2 \n } \n }, \n { \n \"_id\" : \"products/204196958\", \n \"_rev\" : \"204196958\", \n \"_key\" : \"204196958\", \n \"i\" : 1 \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Retrieving the first document: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/206556254\", \n \"_rev\" : \"206556254\", \n \"_key\" : \"206556254\", \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": "executesSimpleQueryLast"
|
||||
}
|
||||
],
|
||||
|
@ -328,10 +328,10 @@
|
|||
}
|
||||
],
|
||||
"parameters": [],
|
||||
"notes": "<br><br>This will find all documents within a given range. You must declare a skip-list index on the attribute in order to be able to use a range query. <br><br>The call expects a JSON hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>attribute</em>: The attribute path to check.<br><br>- <em>left</em>: The lower bound.<br><br>- <em>right</em>: The upper bound.<br><br>- <em>closed</em>: If true, use interval including <em>left</em> and <em>right</em>, otherwise exclude <em>right</em>, but include <em>left</em>. <br><br>- <em>skip</em>: The documents to skip in the query. (optional)<br><br>- <em>limit</em>: The maximal amount of documents to return. (optional)<br><br>Returns a cursor containing the result, see @ref HttpCursor for details. <br><br>",
|
||||
"notes": "<br><br>This will find all documents within a given range. You must declare a skip-list index on the attribute in order to be able to use a range query. <br><br>The call expects a JSON hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>attribute</em>: The attribute path to check.<br><br>- <em>left</em>: The lower bound.<br><br>- <em>right</em>: The upper bound.<br><br>- <em>closed</em>: If true, use interval including <em>left</em> and <em>right</em>, otherwise exclude <em>right</em>, but include <em>left</em>. <br><br>- <em>skip</em>: The documents to skip in the query. (optional)<br><br>- <em>limit</em>: The maximal amount of documents to return. (optional)<br><br>Returns a cursor containing the result, see the manual for details. <br><br>",
|
||||
"summary": "executes simple range query",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/209616188\", \n \"_rev\" : \"209616188\", \n \"_key\" : \"209616188\", \n \"i\" : 2 \n }, \n { \n \"_id\" : \"products/209812796\", \n \"_rev\" : \"209812796\", \n \"_key\" : \"209812796\", \n \"i\" : 3 \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --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/207932510\", \n \"_rev\" : \"207932510\", \n \"_key\" : \"207932510\", \n \"i\" : 2 \n }, \n { \n \"_id\" : \"products/208129118\", \n \"_rev\" : \"208129118\", \n \"_key\" : \"208129118\", \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"
|
||||
}
|
||||
],
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -352,3 +352,9 @@
|
|||
.firstTh {
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
#shortcutDiv {
|
||||
font-size: 10px;
|
||||
font-weight: 200;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
/*jslint sloppy: true, regexp: true */
|
||||
/*global require, module, Module, ArangoError,
|
||||
REPLICATION_LOGGER_START, REPLICATION_LOGGER_STOP, REPLICATION_LOGGER_STATE,
|
||||
REPLICATION_APPLIER_CONFIGURE, REPLICATION_APPLIER_START, REPLICATION_APPLIER_STOP, REPLICATION_APPLIER_STATE,
|
||||
REPLICATION_APPLIER_CONFIGURE, REPLICATION_APPLIER_START, REPLICATION_APPLIER_STOP,
|
||||
REPLICATION_APPLIER_FORGET, REPLICATION_APPLIER_STATE,
|
||||
SYS_DEBUG_CAN_USE_FAILAT, SYS_DEBUG_SET_FAILAT, SYS_DEBUG_REMOVE_FAILAT, SYS_DEBUG_CLEAR_FAILAT,
|
||||
SYS_DOWNLOAD, SYS_EXECUTE, SYS_LOAD, SYS_LOG_LEVEL, SYS_MD5, SYS_OUTPUT, SYS_PROCESS_STATISTICS,
|
||||
SYS_RAND, SYS_SERVER_STATISTICS, SYS_SPRINTF, SYS_TIME, SYS_START_PAGER, SYS_STOP_PAGER,
|
||||
|
|
|
@ -234,9 +234,18 @@ Graph.prototype.initialize = function (name, vertices, edges) {
|
|||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief return all graphs
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Graph.getAll = function () {
|
||||
return GraphAPI.getAllGraphs();
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief drops the graph, the vertices, and the edges
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Graph.prototype.drop = function () {
|
||||
GraphAPI.deleteGraph(this._properties._key);
|
||||
};
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
</div>
|
||||
<div id="aqlEditor"></div>
|
||||
<button id="submitQueryButton" class="btn btn-success">Submit</button>
|
||||
<div id="shortcutDiv"><b>Submit:</b> CTRL/CMD + Return ; <b>Undo:</b> CTRL/CMD + Z ; <b>Redo:</b> CTRL/CMD + SHIFT + Z </div>
|
||||
</div>
|
||||
|
||||
<div id="new-aql-query" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none">
|
||||
|
|
|
@ -8,20 +8,6 @@ var collectionsView = Backbone.View.extend({
|
|||
searchTimeout: null,
|
||||
|
||||
initialize: function () {
|
||||
var self = this;
|
||||
self.system = {};
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
cache: false,
|
||||
url: "/_admin/version",
|
||||
contentType: "application/json",
|
||||
processData: false,
|
||||
async: false,
|
||||
success: function(data) {
|
||||
self.system.name = data.server;
|
||||
self.system.version = data.version;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
template: new EJS({url: 'js/templates/collectionsView.ejs'}),
|
||||
|
@ -58,7 +44,6 @@ var collectionsView = Backbone.View.extend({
|
|||
$('#searchInput').val('');
|
||||
$('#searchInput').val(val);
|
||||
|
||||
$('.footer-right p').html(this.system.name+' : '+this.system.version);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
|
|
@ -3,13 +3,28 @@
|
|||
|
||||
var footerView = Backbone.View.extend({
|
||||
el: '.footer',
|
||||
init: function () {
|
||||
initialize: function () {
|
||||
var self = this;
|
||||
self.system = {};
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
cache: false,
|
||||
url: "/_admin/version",
|
||||
contentType: "application/json",
|
||||
processData: false,
|
||||
async: false,
|
||||
success: function(data) {
|
||||
self.system.name = data.server;
|
||||
self.system.version = data.version;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
template: new EJS({url: 'js/templates/footerView.ejs'}),
|
||||
|
||||
render: function() {
|
||||
$(this.el).html(this.template.text);
|
||||
$('.footer-right p').html(this.system.name+' : '+this.system.version);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,9 +62,19 @@ var queryView = Backbone.View.extend({
|
|||
},
|
||||
|
||||
aqlShortcuts: function (e) {
|
||||
if (e.ctrlKey && e.keyCode == 13) {
|
||||
if (e.ctrlKey && e.keyCode === 13) {
|
||||
this.submitQuery();
|
||||
}
|
||||
else if (e.metaKey && !e.ctrlKey && e.keyCode === 13) {
|
||||
this.submitQuery();
|
||||
}
|
||||
else if (e.ctrlKey && e.keyCode === 90) {
|
||||
this.undoText();
|
||||
}
|
||||
else if (e.ctrlKey && e.shiftKey && e.keyCode === 90) {
|
||||
this.redeText();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
queries: [
|
||||
|
@ -85,7 +95,6 @@ var queryView = Backbone.View.extend({
|
|||
|
||||
inputEditor.getSession().setMode("ace/mode/aql");
|
||||
outputEditor.getSession().setMode("ace/mode/json");
|
||||
inputEditor.setTheme("ace/theme/merbivore_soft");
|
||||
outputEditor.setValue('');
|
||||
|
||||
$('#queryOutput').resizable({
|
||||
|
@ -132,6 +141,8 @@ var queryView = Backbone.View.extend({
|
|||
inputEditor.resize();
|
||||
outputEditor.resize();
|
||||
|
||||
inputEditor.setTheme("ace/theme/merbivore_soft");
|
||||
|
||||
this.renderSelectboxes();
|
||||
$('#queryDiv').show();
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ border-color: #E6E1DC\
|
|||
.ace-merbivore-soft .ace_comment,\
|
||||
.ace-merbivore-soft .ace_meta {\
|
||||
font-style: italic;\
|
||||
color: #AC4BB8\
|
||||
color: #8AA051\
|
||||
}\
|
||||
.ace-merbivore-soft .ace_entity.ace_other.ace_attribute-name {\
|
||||
color: #EAF1A3\
|
||||
|
|
|
@ -162,31 +162,48 @@ function collectionRepresentation (collection, showProperties, showCount, showFi
|
|||
///
|
||||
/// @EXAMPLE_ARANGOSH_RUN{RestCollectionCreateCollection}
|
||||
/// var url = "/_api/collection";
|
||||
/// var body = '{ "name": "testCollectionBasics" }';
|
||||
/// var body = {
|
||||
/// name: "testCollectionBasics"
|
||||
/// };
|
||||
///
|
||||
/// var response = logCurlRequest('POST', url, body);
|
||||
/// var response = logCurlRequest('POST', url, JSON.stringify(body));
|
||||
///
|
||||
/// assert(response.code === 200);
|
||||
///
|
||||
/// logJsonResponse(response);
|
||||
/// body = '{ "name": "testCollectionEdges", "type" : 3 }';
|
||||
/// body = {
|
||||
/// name: "testCollectionEdges",
|
||||
/// type : 3
|
||||
/// };
|
||||
///
|
||||
/// var response = logCurlRequest('POST', url, body);
|
||||
/// var response = logCurlRequest('POST', url, JSON.stringify(body));
|
||||
///
|
||||
/// assert(response.code === 200);
|
||||
///
|
||||
/// logJsonResponse(response);
|
||||
///
|
||||
/// db._flushCache();
|
||||
/// db._drop("testCollectionBasics");
|
||||
/// db._drop("testCollectionEdges");
|
||||
/// @END_EXAMPLE_ARANGOSH_RUN
|
||||
///
|
||||
/// @EXAMPLE_ARANGOSH_RUN{RestCollectionCreateKeyopt}
|
||||
/// var url = "/_api/collection";
|
||||
/// var body = '{ "name": "testCollectionUsers", "keyOptions" : { "type" : "autoincrement", "increment" : 5, "allowUserKeys" : true }}';
|
||||
/// var body = {
|
||||
/// name: "testCollectionUsers",
|
||||
/// keyOptions : {
|
||||
/// type : "autoincrement",
|
||||
/// increment : 5,
|
||||
/// allowUserKeys : true
|
||||
/// }
|
||||
/// };
|
||||
///
|
||||
/// var response = logCurlRequest('POST', url, body);
|
||||
/// var response = logCurlRequest('POST', url, JSON.stringify(body));
|
||||
///
|
||||
/// assert(response.code === 200);
|
||||
///
|
||||
/// logJsonResponse(response);
|
||||
///
|
||||
/// db._flushCache();
|
||||
/// db._drop("testCollectionUsers");
|
||||
/// @END_EXAMPLE_ARANGOSH_RUN
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -1091,9 +1108,11 @@ function put_api_collection_properties (req, res, collection) {
|
|||
/// var coll = db._create(cn);
|
||||
/// var url = "/_api/collection/"+ coll._id + "/rename";
|
||||
///
|
||||
/// var response = logCurlRequest('PUT', url, { "name": "newname" });
|
||||
/// var response = logCurlRequest('PUT', url, { name: "newname" });
|
||||
///
|
||||
/// assert(response.code === 200);
|
||||
/// db._flushCache();
|
||||
/// db._drop("newname");
|
||||
///
|
||||
/// logJsonResponse(response);
|
||||
/// @END_EXAMPLE_ARANGOSH_RUN
|
||||
|
|
|
@ -130,7 +130,7 @@ function graph_by_request (req) {
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief returns true if a "if-match" or "if-none-match" errer happens
|
||||
/// @brief returns true if a "if-match" or "if-none-match" error happens
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function matchError (req, res, doc, errorCode) {
|
||||
|
@ -282,21 +282,27 @@ function post_graph_graph (req, res) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief get graph properties
|
||||
///
|
||||
/// @RESTHEADER{GET /_api/graph/{graph-name},get graph properties}
|
||||
/// @RESTHEADER{GET /_api/graph/{graph-name},get the properties of a specific or all graphs}
|
||||
///
|
||||
/// @RESTURLPARAMETERS
|
||||
///
|
||||
/// @RESTURLPARAM{graph-name,string,required}
|
||||
/// The name of the graph
|
||||
/// @RESTURLPARAM{graph-name,string,optional}
|
||||
/// The name of the graph.
|
||||
///
|
||||
/// @RESTHEADERPARAMETERS
|
||||
///
|
||||
/// @RESTHEADERPARAM{If-None-Match,string,optional}
|
||||
/// If `graph-name` is specified, then this header can be used to check
|
||||
/// whether a specific graph has changed or not.
|
||||
///
|
||||
/// If the "If-None-Match" header is given, then it must contain exactly one
|
||||
/// etag. The document is returned, if it has a different revision than the
|
||||
/// etag. The document is returned if it has a different revision than the
|
||||
/// given etag. Otherwise a `HTTP 304` is returned.
|
||||
///
|
||||
/// @RESTHEADERPARAM{If-Match,string,optional}
|
||||
/// If `graph-name` is specified, then this header can be used to check
|
||||
/// whether a specific graph has changed or not.
|
||||
///
|
||||
/// If the "If-Match" header is given, then it must contain exactly one
|
||||
/// etag. The document is returned, if it has the same revision ad the
|
||||
/// given etag. Otherwise a `HTTP 412` is returned. As an alternative
|
||||
|
@ -304,25 +310,32 @@ function post_graph_graph (req, res) {
|
|||
///
|
||||
/// @RESTDESCRIPTION
|
||||
///
|
||||
/// Returns an object with an attribute `graph` containing a
|
||||
/// list of all graph properties.
|
||||
/// If `graph-name` is specified, returns an object with an attribute `graph`
|
||||
/// containing a JSON hash with all properties of the specified graph.
|
||||
///
|
||||
/// If `graph-name` is not specified, returns a list of graph objects.
|
||||
///
|
||||
/// @RESTRETURNCODES
|
||||
///
|
||||
/// @RESTRETURNCODE{200}
|
||||
/// is returned if the graph was found
|
||||
/// is returned if the graph was found (in case `graph-name` was specified)
|
||||
/// or the list of graphs was assembled successfully (in case `graph-name`
|
||||
/// was not specified).
|
||||
///
|
||||
/// @RESTRETURNCODE{404}
|
||||
/// is returned if the graph was not found.
|
||||
/// is returned if the graph was not found. This response code may only be
|
||||
/// returned if `graph-name` is specified in the request.
|
||||
/// The response body contains an error document in this case.
|
||||
///
|
||||
/// @RESTRETURNCODE{304}
|
||||
/// "If-None-Match" header is given and the current graph has not a different
|
||||
/// version
|
||||
/// version. This response code may only be returned if `graph-name` is
|
||||
/// specified in the request.
|
||||
///
|
||||
/// @RESTRETURNCODE{412}
|
||||
/// "If-Match" header or `rev` is given and the current graph has
|
||||
/// a different version
|
||||
/// a different version. This response code may only be returned if `graph-name`
|
||||
/// is specified in the request.
|
||||
///
|
||||
/// @EXAMPLES
|
||||
///
|
||||
|
@ -341,6 +354,26 @@ function post_graph_graph (req, res) {
|
|||
/// db._drop("vertices");
|
||||
/// db._graphs.remove("graph");
|
||||
/// @END_EXAMPLE_ARANGOSH_RUN
|
||||
///
|
||||
/// get all graphs
|
||||
///
|
||||
/// @EXAMPLE_ARANGOSH_RUN{RestGraphGetGraphs}
|
||||
/// var Graph = require("org/arangodb/graph").Graph;
|
||||
/// new Graph("graph1", "vertices1", "edges1");
|
||||
/// new Graph("graph2", "vertices2", "edges2");
|
||||
/// var url = "/_api/graph";
|
||||
/// var response = logCurlRequest('GET', url);
|
||||
///
|
||||
/// assert(response.code === 200);
|
||||
///
|
||||
/// logJsonResponse(response);
|
||||
/// db._drop("edges1");
|
||||
/// db._drop("vertices2");
|
||||
/// db._drop("edges1");
|
||||
/// db._drop("vertices2");
|
||||
/// db._graphs.remove("graph1");
|
||||
/// db._graphs.remove("graph2");
|
||||
/// @END_EXAMPLE_ARANGOSH_RUN
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function get_graph_graph (req, res) {
|
||||
|
@ -355,7 +388,7 @@ function get_graph_graph (req, res) {
|
|||
"Etag" : g._properties._rev
|
||||
};
|
||||
|
||||
actions.resultOk(req, res, actions.HTTP_OK, { "graph" : g._properties}, headers );
|
||||
actions.resultOk(req, res, actions.HTTP_OK, { "graph" : g._properties }, headers );
|
||||
}
|
||||
catch (err) {
|
||||
actions.resultNotFound(req, res, arangodb.ERROR_GRAPH_INVALID_GRAPH, err);
|
||||
|
@ -799,7 +832,6 @@ function update_graph_vertex (req, res, g, isPatch) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief updates a vertex
|
||||
///
|
||||
|
@ -2176,8 +2208,9 @@ function post_graph (req, res) {
|
|||
|
||||
function get_graph (req, res) {
|
||||
if (req.suffix.length === 0) {
|
||||
// GET /_api/graph
|
||||
actions.resultUnsupported(req, res);
|
||||
// GET /_api/graph: return all graphs
|
||||
|
||||
actions.resultOk(req, res, actions.HTTP_OK, { "graphs" : graph.Graph.getAll() });
|
||||
}
|
||||
else if (req.suffix.length === 1) {
|
||||
// GET /_api/graph/<key>
|
||||
|
|
|
@ -58,6 +58,12 @@ GraphAPI = {
|
|||
return GraphAPI.sendWithoutData("GET", graphKey, "");
|
||||
},
|
||||
|
||||
getAllGraphs: function () {
|
||||
var results = arangodb.arango.GET("/_api/graph");
|
||||
arangosh.checkRequestResult(results);
|
||||
return results.graphs;
|
||||
},
|
||||
|
||||
postGraph: function (data) {
|
||||
var results = arangodb.arango.POST("/_api/graph", JSON.stringify(data));
|
||||
arangosh.checkRequestResult(results);
|
||||
|
|
|
@ -233,9 +233,18 @@ Graph.prototype.initialize = function (name, vertices, edges) {
|
|||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief return all graphs
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Graph.getAll = function () {
|
||||
return GraphAPI.getAllGraphs();
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief drops the graph, the vertices, and the edges
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Graph.prototype.drop = function () {
|
||||
GraphAPI.deleteGraph(this._properties._key);
|
||||
};
|
||||
|
|
|
@ -511,6 +511,32 @@ Graph.prototype.initialize = function (name, vertices, edges, waitForSync) {
|
|||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @fn JSF_graph_getAll
|
||||
/// @brief returns all available graphs
|
||||
///
|
||||
/// @FUN{@FA{graph}.getAll()}
|
||||
///
|
||||
/// Returns all available graphs.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function getAllGraphs () {
|
||||
var gdb = db._collection("_graphs"),
|
||||
graphs = [ ];
|
||||
|
||||
gdb.toArray().forEach(function(doc) {
|
||||
var g = new Graph(doc._key);
|
||||
|
||||
if (g._properties !== null) {
|
||||
graphs.push(g._properties);
|
||||
}
|
||||
});
|
||||
|
||||
return graphs;
|
||||
}
|
||||
|
||||
Graph.getAll = getAllGraphs;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief drops the graph, the vertices, and the edges
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue