1
0
Fork 0

Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel

Conflicts:
	js/apps/system/aardvark/frontend/js/views/graphManagementView.js
This commit is contained in:
gschwab 2014-06-25 16:33:32 +02:00
commit 165daa0c1e
32 changed files with 887 additions and 944 deletions

View File

@ -9,8 +9,19 @@ A lot of the following functions accept a vertex (or edge) example as parameter.
* {} : Returns all possible vertices for this graph.
* *idString* : Returns the vertex/edge with the id *idString*.
* {*key1* : *value1*, *key2* : *value2*} : Returns the vertices/edges that match this example, which means that both have *key1* and *key2* with the corresponding attributes.
* {*key1.key2* : *value1*, *key3* : *value2*} : It is possible to chain keys which means that a document *{ key1 : {key2 : value1}, key3 : value2}* would be a match.
* [{*key1* : *value1*}, {*key2* : *value2*}] : Returns the vertices/edges that match one of the examples, which means that either *key1* or *key2* are set with the corresponding value.
!SUBSECTION The complexity of the shortest path algorithms
Most of the functions described in this chapter calculate the shortest paths for subsets of the graphs vertices.
Hence the complexity of these functions depends of the chosen algorithm for this task. For
[Floyd-Warshall](http://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm) it is **O(n^3)**
with *n* being the amount of vertices in the graph. For
[Dijkstra](http://en.wikipedia.org/wiki/Dijkstra's_algorithm) it would be **O(x\*y\*n^2)** with *n* being
the amount of vertices in the graph, *x* the amount of start vertices and *y* the amount of
target vertices. Hence a suggestion might be to use Dijkstra when x\*y < n and the functions supports chosing your algorithm.
!SUBSECTION Edges and Vertices related functions
This section describes various AQL functions which can be used to receive information about the graph's vertices, edges, neighbor relationship and shared properties.

View File

@ -16,6 +16,10 @@
<!-- arangod/V8-Server/v8-vocbase.cpp -->
@startDocuBlock collectionFigures
!SUBSECTION Load
<!-- arangod/V8-Server/v8-vocbase.cpp -->
@startDocuBlock collectionLoad
!SUBSECTION Reserve
`collection.reserve( number)`

View File

@ -10,7 +10,7 @@
!SUBSECTION All Collections
<!-- arangod/V8-Server/v8-vocbase.cpp -->
@startDocuBlock collectionDatabaseCreate
@startDocuBlock collectionDatabaseNameAll
!SUBSECTION Collection Name
<!-- arangod/V8-Server/v8-vocbase.cpp -->

View File

@ -6,35 +6,34 @@ The following methods are available to manage databases via JavaScript.
Please note that several of these methods can be used from the _system
database only.
!SUBSECTION Name
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock databaseName
!SUBSECTION ID
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock databaseId
!SUBSECTION Path
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock databasePath
!SUBSECTION isSystem
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock databaseIsSystem
!SUBSECTION Use Database
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock databaseUseDatabase
!SUBSECTION Is Database
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock databaseListDatabase
!SUBSECTION Create Database
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock databaseCreateDatabase
!SUBSECTION Drop Database
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock databaseDropDatabase

View File

@ -22,381 +22,52 @@
!SUBSECTION Count
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock colllectionCount
@startDocuBlock collectionCount
!SUBSECTION toArray
<!-- js/server/modules/org/arangodb/arango-collection.js-->
@startDocuBlock collectionToArray
!SUBSECTION Document
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock documentsCollectionName
!SUBSECTION Exists
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock documentsCollectionExists
!SUBSECTION Save
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock documentsCollectionSave
!SUBSECTION Replace
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock documentsCollectionReplace
!SUBSECTION Update
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock documentsCollectionUpdate
!SUBSECTION Remove
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock documentsCollectionRemove
!SUBSECTION Remove By Example
<!-- js/common/modules/org/arangodb/arango-collection-common.js-->
@startDocuBlock documentsCollectionRemoveByExample
!SUBSECTION Replace By Example
<!-- js/common/modules/org/arangodb/arango-collection-common.js-->
@startDocuBlock documentsCollectionReplaceByExample
!SUBSECTION Update By Example
<!-- js/common/modules/org/arangodb/arango-collection-common.js-->
@startDocuBlock documentsCollectionUpdateByExample
!SUBSECTION First
<!-- js/server/modules/org/arangodb/arango-collection.js-->
@startDocuBlock documentsCollectionFirst
!SUBSECTION Last
<!-- js/server/modules/org/arangodb/arango-collection.js-->
@startDocuBlock documentsCollectionLast
`collection.document( document)`
The document method finds a document given its identifier. It returns the document. Note that the returned document contains two pseudo-attributes, namely _id and _rev. _id contains the document-handle and _rev the revision of the document.
An error is thrown if the _rev does not longer match the current revision of the document.
An error is also thrown if the document does not exist.
`collection.document( document-handle)`
As before. Instead of document a document-handle can be passed as first argument.
*Examples*
Returns the document for a document-handle:
arango> db.example.document("1432124/2873916");
{ "_id" : "1432124/2873916", "_rev" : "2873916", "Hello" : "World" }
An error is raised if the document is unknown:
arango> db.example.document("1432124/123456");
JavaScript exception in file '(arango)' at 1,12:
[ArangoError 1202: document not found: document not found]
!db.example.document("1432124/123456");
! ^
An error is raised if the handle is invalid:
arango> db.example.document("12345");
JavaScript exception in file '(arango)' at 1,12:
[ArangoError 10: bad parameter: <document-identifier> must be a document identifier]
!db.example.document("12345");
! ^
`collection.exists( document)`
The exists method determines whether a document exists given its identifier. Instead of returning the found document or an error, this method will return either true or false. It can thus be used for easy existence checks.
The document method finds a document given its identifier. It returns the document. Note that the returned document contains two pseudo-attributes, namely _id and _rev. _id contains the document-handle and _rev the revision of the document.
No error will be thrown if the sought document or collection does not exist. Still this method will throw an error if used improperly, e.g. when called with a non-document handle, a non-document, or when a cross-collection request is performed.
`collection.exists( document-handle)`
As before. Instead of document a document-handle can be passed as first argument.
`collection.save( data)`
Creates a new document in the collection from the given data. The data must be a hash array. It must not contain attributes starting with _.
The method returns a document with the attributes _id and _rev. The attribute _id contains the document handle of the newly created document, the attribute _rev contains the document revision.
`collection.save( data, waitForSync)`
Creates a new document in the collection from the given data as above. The optional waitForSync parameter can be used to force synchronisation of the document creation operation to disk even in case that the waitForSync flag had been disabled for the entire collection. Thus, the waitForSync parameter can be used to force synchronisation of just specific operations. To use this, set the waitForSync parameter to true. If the waitForSync parameter is not specified or set to false, then the collection's default waitForSync behavior is applied. The waitForSync parameter cannot be used to disable synchronisation for collections that have a default waitForSync value of true.
*Examples*
arango> db.example.save({ Hello : "World" })
{ "_id" : "example/3175486", "_key" : "3175486", "_rev" : "3175486" }
arango> db.example.save({ Hello : "World" }, true)
{ "_id" : "example/3179437", "_key" : "3179437", "_rev" : "3179437" }
`collection.replace( document, data)`
Replaces an existing document. The document must be a document in the current collection. This document is then replaced with the data given as second argument.
The method returns a document with the attributes _id, _rev and _oldRev. The attribute _id contains the document handle of the updated document, the attribute _rev contains the document revision of the updated document, the attribute _oldRev contains the revision of the old (now replaced) document.
If there is a conflict, i. e. if the revision of the document does not match the revision in the collection, then an error is thrown.
`collection.replace( document, data, true)`
As before, but in case of a conflict, the conflict is ignored and the old document is overwritten.
`collection.replace( document, data, true, waitForSync)`
The optional waitForSync parameter can be used to force synchronisation of the document replacement operation to disk even in case that the waitForSync flag had been disabled for the entire collection. Thus, the waitForSync parameter can be used to force synchronisation of just specific operations. To use this, set the waitForSync parameter to true. If the waitForSync parameter is not specified or set to false, then the collection's default waitForSync behavior is applied. The waitForSync parameter cannot be used to disable synchronisation for collections that have a default waitForSync value of true.
`collection.replace( document-handle, data)`
As before. Instead of document a document-handle can be passed as first argument.
*Examples*
Create and update a document:
arango> a1 = db.example.save({ a : 1 });
{ "_id" : "example/3903044", "_key" : "3903044", "_rev" : "3903044" }
arango> a2 = db.example.replace(a1, { a : 2 });
{ "_id" : "example/3903044", "_key" : "3903044", "_rev" : "3968580", "_oldRev" : "3903044" }
arango> a3 = db.example.replace(a1, { a : 3 });
JavaScript exception in file '(arango)' at 1,17: [ArangoError 1200: conflict: cannot replace document]
!a3 = db.example.replace(a1, { a : 3 })
! ^
arango> a4 = db.example.replace(a1, { a : 4 }, true);
{ "_id" : "example/3903044", "_key" : "3903044", "_rev" : "4034116", "_oldRev" : "3968580" }
Use a document handle:
arango> a5 = db.example.replace("1432124/3903044", { a : 5 });
{ "_id" : "example/3903044", "_key" : "3903044", "_rev" : "4099652", "_oldRev" : "4034116" }
`collection.update( document, data, overwrite, keepNull, waitForSync)`
Updates an existing document. The document must be a document in the current collection. This document is then patched with the data given as second argument. The optional overwrite parameter can be used to control the behavior in case of version conflicts (see below). The optional keepNull parameter can be used to modify the behavior when handling null values. Normally, null values are stored in the database. By setting the keepNull parameter to false, this behavior can be changed so that all attributes in data with null values will be removed from the target document.
The optional waitForSync parameter can be used to force synchronisation of the document update operation to disk even in case that the waitForSync flag had been disabled for the entire collection. Thus, the waitForSync parameter can be used to force synchronisation of just specific operations. To use this, set the waitForSync parameter to true. If the waitForSync parameter is not specified or set to false, then the collection's default waitForSync behavior is applied. The waitForSync parameter cannot be used to disable synchronisation for collections that have a default waitForSync value of true.
The method returns a document with the attributes _id, _rev and _oldRev. The attribute _id contains the document handle of the updated document, the attribute _rev contains the document revision of the updated document, the attribute _oldRev contains the revision of the old (now replaced) document.
If there is a conflict, i. e. if the revision of the document does not match the revision in the collection, then an error is thrown.
`collection.update( document, data, true)`
As before, but in case of a conflict, the conflict is ignored and the old document is overwritten.
`collection.update( document-handle, data)`
As before. Instead of document a document-handle can be passed as first argument.
*Examples*
Create and update a document:
arango> a1 = db.example.save({"a" : 1});
{ "error" : false, "_id" : "example/18612115", "_key" : "18612115", "_rev" : "18612115" }
arango> a2 = db.example.update(a1, {"b" : 2, "c" : 3});
{ "error" : false, "_id" : "example/18612115", "_key" : "18612115", "_rev" : "18874259" }
arango> a3 = db.example.update(a1, {"d" : 4});
JavaScript exception in file 'client/client.js' at 1876,7: [ArangoError 1200: precondition failed]
! throw new ArangoError(requestResult);
! ^
arango> a4 = db.example.update(a2, {"e" : 5, "f" : 6 });
{ "error" : false, "_id" : "example/18612115", "_key" : "18612115", "_rev" : "19267475" }
arango> db.example.document(a4);
{ "a" : 1, "b" : 2, "c" : 3, "e" : 5, "f" : 6, "_id" : "example/18612115", "_key" : "18612115", "_rev" : "19267475" }
arango> a5 = db.example.update(a4, {"a" : 1, c : 9, e : 42 });
{ "error" : false, "_id" : "example/18612115", "_key" : "18612115", "_rev" : "19333011" }
arango> db.example.document(a5);
{ "a" : 1, "b" : 2, "c" : 9, "e" : 42, "f" : 6, "_id" : "example/18612115", "_key" : "18612115", "_rev" : "19333011" }
Use a document handle:
arango> a6 = db.example.update("example/18612115", { "x" : 1, "y" : 2 });
{ "error" : false, "_id" : "example/18612115", "_key" : "18612115", "_rev" : "19595155" }
Use the keepNull parameter to remove attributes with null values:
arango> db.example.save({"a" : 1});
{ "error" : false, "_id" : "example/19988371", "_key" : "19988371", "_rev" : "19988371" }
arango> db.example.update("example/19988371", { "b" : null, "c" : null, "d" : 3 });
{ "error" : false, "_id" : "example/19988371", "_key" : "19988371", "_rev" : "20119443" }
arango> db.example.document("example/19988371");
{ "b" : null, "c" : null, "a" : 1, "d" : 3, "_id" : "example/19988371", "_key" : "19988371", "_rev" : "20119443" }
arango> db.example.update("example/19988371", { "a" : null }, false, false);
{ "error" : false, "_id" : "example/19988371", "_key" : "19988371", "_rev" : "20250515" }
arango> db.example.document("example/19988371");
{ "b" : null, "c" : null, "d" : 3, "_id" : "example/19988371", "_key" : "19988371", "_rev" : "20250515" }
arango> db.example.update("example/19988371", { "b" : null, "c": null, "d" : null }, false, false);
{ "error" : false, "_id" : "example/19988371", "_key" : "19988371", "_rev" : "20381587" }
arango> db.example.document("example/19988371");
{ "_id" : "example/19988371", "_key" : "19988371", "_rev" : "20381587" }
Patching array values:
arango> db.example.save({"a" : { "one" : 1, "two" : 2, "three" : 3 }, "b" : { }});
{ "error" : false, "_id" : "example/20774803", "_key" : "20774803", "_rev" : "20774803" }
arango> db.example.update("example/20774803", {"a" : { "four" : 4 }, "b" : { "b1" : 1 }});
{ "error" : false, "_id" : "example/20774803", "_key" : "20774803", "_rev" : "21168019" }
arango> db.example.document("example/20774803");
{ "a" : { "one" : 1, "two" : 2, "three" : 3, "four" : 4 }, "b" : { "b1" : 1 }, "_id" : "example/20774803", "_key" : "20774803", "_rev" : "21168019" }
arango> db.example.update("example/20774803", { "a" : { "one" : null }, "b" : null }, false, false);
{ "error" : false, "_id" : "example/20774803", "_key" : "20774803", "_rev" : "21364627" }
arango> db.example.document("example/20774803");
{ "a" : { "two" : 2, "three" : 3, "four" : 4 }, "_id" : "example/20774803", "_key" : "20774803", "_rev" : "21364627" }
`collection.remove( document)`
Removes a document. If there is revision mismatch, then an error is thrown.
`collection.remove( document, true)`
Removes a document. If there is revision mismatch, then mismatch is ignored and document is deleted. The function returns true if the document existed and was deleted. It returns false, if the document was already deleted.
`collection.remove( document, true, waitForSync)`
The optional waitForSync parameter can be used to force synchronisation of the document deletion operation to disk even in case that the waitForSync flag had been disabled for the entire collection. Thus, the waitForSync parameter can be used to force synchronisation of just specific operations. To use this, set the waitForSync parameter to true. If the waitForSync parameter is not specified or set to false, then the collection's default waitForSync behavior is applied. The waitForSync parameter cannot be used to disable synchronisation for collections that have a default waitForSync value of true.
`collection.remove( document-handle, data)`
As before. Instead of document a document-handle can be passed as first argument.
*Examples*
Remove a document:
arango> a1 = db.example.save({ a : 1 });
{ "_id" : "116308/3449537", "_rev" : "3449537" }
arango> db.example.document(a1);
{ "_id" : "116308/3449537", "_rev" : "3449537", "a" : 1 }
arango> db.example.remove(a1);
true
arango> db.example.document(a1);
JavaScript exception in file '(arango)' at 1,12: [ArangoError 1202: document not found: document not found]
!db.example.document(a1);
! ^
Remove a document with a conflict:
arango> a1 = db.example.save({ a : 1 });
{ "_id" : "116308/3857139", "_rev" : "3857139" }
arango> a2 = db.example.replace(a1, { a : 2 });
{ "_id" : "116308/3857139", "_rev" : "3922675", "_oldRev" : 3857139 }
arango> db.example.remove(a1);
JavaScript exception in file '(arango)' at 1,18: [ArangoError 1200: conflict: cannot remove document]
!db.example.remove(a1);
! ^
arango> db.example.remove(a1, true);
true
arango> db.example.document(a1);
JavaScript exception in file '(arango)' at 1,12: [ArangoError 1202: document not found: document not found]
!db.example.document(a1);
! ^
`collection.removeByExample( example)`
Removes all documents matching an example.
`collection.removeByExample( document, waitForSync)`
The optional waitForSync parameter can be used to force synchronisation of the document deletion operation to disk even in case that the waitForSync flag had been disabled for the entire collection. Thus, the waitForSync parameter can be used to force synchronisation of just specific operations. To use this, set the waitForSync parameter to true. If the waitForSync parameter is not specified or set to false, then the collection's default waitForSync behavior is applied. The waitForSync parameter cannot be used to disable synchronisation for collections that have a default waitForSync value of true.
`collection.removeByExample( document, waitForSync, limit)`
The optional limit parameter can be used to restrict the number of removals to the specified value. If limit is specified but less than the number of documents in the collection, it is undefined which documents are removed.
*Examples*
arangod> db.content.removeByExample({ "domain": "de.celler" })
`collection.replaceByExample( example, newValue)`
Replaces all documents matching an example with a new document body. The entire document body of each document matching the example will be replaced with newValue. The document meta-attributes such as _id, _key, _from, _to will not be replaced.
`collection.replaceByExample( document, newValue, waitForSync)`
The optional waitForSync parameter can be used to force synchronisation of the document replacement operation to disk even in case that the waitForSync flag had been disabled for the entire collection. Thus, the waitForSync parameter can be used to force synchronisation of just specific operations. To use this, set the waitForSync parameter to true. If the waitForSync parameter is not specified or set to false, then the collection's default waitForSync behavior is applied. The waitForSync parameter cannot be used to disable synchronisation for collections that have a default waitForSync value of true.
`collection.replaceByExample( document, newValue, waitForSync, limit)`
The optional limit parameter can be used to restrict the number of replacements to the specified value. If limit is specified but less than the number of documents in the collection, it is undefined which documents are replaced.
*Examples*
arangod> db.content.replaceByExample({ "domain": "de.celler" }, { "foo": "someValue }, false, 5)
`collection.updateByExample( example, newValue)`
Partially updates all documents matching an example with a new document body. Specific attributes in the document body of each document matching the example will be updated with the values from newValue. The document meta-attributes such as _id, _key, _from, _to cannot be updated.
`collection.updateByExample( document, newValue, keepNull, waitForSync)`
The optional keepNull parameter can be used to modify the behavior when handling null values. Normally, null values are stored in the database. By setting the keepNull parameter to false, this behavior can be changed so that all attributes in data with null values will be removed from the target document.
The optional waitForSync parameter can be used to force synchronisation of the document replacement operation to disk even in case that the waitForSync flag had been disabled for the entire collection. Thus, the waitForSync parameter can be used to force synchronisation of just specific operations. To use this, set the waitForSync parameter to true. If the waitForSync parameter is not specified or set to false, then the collection's default waitForSync behavior is applied. The waitForSync parameter cannot be used to disable synchronisation for collections that have a default waitForSync value of true.
`collection.updateByExample( document, newValue, keepNull, waitForSync, limit)`
The optional limit parameter can be used to restrict the number of updates to the specified value. If limit is specified but less than the number of documents in the collection, it is undefined which documents are updated.
*Examples*
arangod> db.content.updateByExample({ "domain": "de.celler" }, { "foo": "someValue, "domain": null }, false)
`collection.first( count)`
The first method returns the n first documents from the collection, in order of document insertion/update time.
If called with the count argument, the result is a list of up to count documents. If count is bigger than the number of documents in the collection, then the result will contain as many documents as there are in the collection. The result list is ordered, with the "oldest" documents being positioned at the beginning of the result list.
When called without an argument, the result is the first document from the collection. If the collection does not contain any documents, the result returned is null.
*Examples*
arangod> db.example.first(1)
[ { "_id" : "example/222716379559", "_rev" : "222716379559", "Hello" : "World" } ]
arangod> db.example.first()
{ "_id" : "example/222716379559", "_rev" : "222716379559", "Hello" : "World" }
`collection.last( count)`
The first method returns the n last documents from the collection, in order of document insertion/update time.
If called with the count argument, the result is a list of up to count documents. If count is bigger than the number of documents in the collection, then the result will contain as many documents as there are in the collection. The result list is ordered, with the "latest" documents being positioned at the beginning of the result list.
When called without an argument, the result is the last document from the collection. If the collection does not contain any documents, the result returned is null.
*Examples*
arangod> db.example.last(1)
[ { "_id" : "example/222716379559", "_rev" : "222716379559", "Hello" : "World" } ]
arangod> db.example.last()
{ "_id" : "example/222716379559", "_rev" : "222716379559", "Hello" : "World" }
<!--
@anchor HandlingDocumentsRead
@copydetails JS_DocumentVocbaseCol
@CLEARPAGE
@anchor HandlingDocumentsExists
@copydetails JS_ExistsVocbaseCol
@CLEARPAGE
@anchor HandlingDocumentsAny
@copydetails JS_AnyQuery
@CLEARPAGE
@anchor HandlingDocumentsCreate
@copydetails JS_SaveVocbaseCol
@CLEARPAGE
@anchor HandlingDocumentsReplace
@copydetails JS_ReplaceVocbaseCol
@CLEARPAGE
@anchor HandlingDocumentsUpdate
@copydetails JS_UpdateVocbaseCol
@CLEARPAGE
@anchor HandlingDocumentsRemove
@copydetails JS_RemoveVocbaseCol
@CLEARPAGE
@anchor HandlingDocumentsRemoveByExample
@copydetails JSF_ArangoCollection_prototype_removeByExample
@CLEARPAGE
@anchor HandlingDocumentsReplaceByExample
@copydetails JSF_ArangoCollection_prototype_replaceByExample
@CLEARPAGE
@anchor HandlingDocumentsUpdateByExample
@copydetails JSF_ArangoCollection_prototype_updateByExample
@CLEARPAGE
@anchor HandlingDocumentsFirst
@copydetails JSF_ArangoCollection_prototype_first
@CLEARPAGE
@anchor HandlingDocumentsLast
@copydetails JSF_ArangoCollection_prototype_last
-->
@startDocuBlock documentsCollectionLast

View File

@ -1,7 +1,5 @@
!CHAPTER Windows
!SECTION Choices
The default installation directory is *c:\Program Files\ArangoDB-1.x.y*. During the
installation process you may change this. In the following description we will assume
that ArangoDB has been installed in the location *<ROOTDIR>*.

View File

@ -49,7 +49,6 @@ def replaceText(text, pathOfFile, searchText):
replaced = replaced.replace("@RESTRETURNCODES","*Return Codes*")
replaced = re.sub(r"@RESTPARAM{([\s\w\-]*),([\s\w\_\|-]*),\s[optional]}", r"* *\g<1>* (\g<3>):", replaced)
replaced = re.sub(r"@RESTPARAM{([\s\w-]*),([\s\w\_\|-]*),\s*(\w+)}", r"* *\g<1>*:", replaced)
# replaced = re.sub(r"@RESTPARAM{(\s*\w+\-*\w+),(\s*\w+),\s*(\w+)}", r"* *\g<1>* (\g<3>):", replaced)
replaced = re.sub(r"@RESTRETURNCODE{(.*)}", r"* *HTTP \g<1>*:", replaced)
replaced = re.sub(r"@RESTBODYPARAMS{(.*)}", r"*(\g<1>)*", replaced)
replaced = replaced.replace("@EXAMPLES","*Examples*")

View File

@ -1,5 +0,0 @@
arango> col = db.example;
[ArangoCollection 164208316, "example" (status unloading)]
arango> col.load();
arango> col;
[ArangoCollection 164208316, "example" (status loaded)]

View File

@ -1,5 +0,0 @@
arango> db.example.save({ Hello : "World" })
{ "_id" : "example/3175486", "_key" : "3175486", "_rev" : "3175486" }
arango> db.example.save({ Hello : "World" }, true)
{ "_id" : "example/3179437", "_key" : "3179437", "_rev" : "3179437" }

View File

@ -1,10 +0,0 @@
arango> a1 = db.example.save({ a : 1 });
{ "_id" : "example/3903044", "_key" : "3903044", "_rev" : "3903044" }
arango> a2 = db.example.replace(a1, { a : 2 });
{ "_id" : "example/3903044", "_key" : "3903044", "_rev" : "3968580", "_oldRev" : "3903044" }
arango> a3 = db.example.replace(a1, { a : 3 });
JavaScript exception in file '(arango)' at 1,17: [ArangoError 1200: conflict: cannot replace document]
!a3 = db.example.replace(a1, { a : 3 })
! ^
arango> a4 = db.example.replace(a1, { a : 4 }, true);
{ "_id" : "example/3903044", "_key" : "3903044", "_rev" : "4034116", "_oldRev" : "3968580" }

View File

@ -1,10 +0,0 @@
arango> a1 = db.example.save({ a : 1 });
{ "_id" : "example/1717678", "_key" : "1717678", "_rev" : "1717678" }
arango> a2 = db._replace(a1, { a : 2 });
{ "_id" : "example/1717678", "_key" : "1717678", "_rev" : "1783214", "_oldRev" : "1717678" }
arango> a3 = db._replace(a1, { a : 3 });
JavaScript exception in file '(arango)' at 1,9: [ArangoError 1200: conflict: cannot replace document]
!a3 = db._replace(a1, { a : 3 });
! ^
arango> a4 = db.example.replace(a1, { a : 4 }, true);
{ "_id" : "example/1717678", "_key" : "1717678", "_rev" : "1848750", "_oldRev" : "1783214" }

View File

@ -1,2 +0,0 @@
arango> a5 = db.example.replace("example/3903044", { a : 5 });
{ "_id" : "example/3903044", "_key" : "3903044", "_rev" : "4099652", "_oldRev" : "4034116" }

View File

@ -1,17 +0,0 @@
arango> a1 = db.example.save({"a" : 1});
{ "error" : false, "_id" : "example/18612115", "_key" : "18612115", "_rev" : "18612115" }
arango> a2 = db.example.update(a1, {"b" : 2, "c" : 3});
{ "error" : false, "_id" : "example/18612115", "_key" : "18612115", "_rev" : "18874259" }
arango> a3 = db.example.update(a1, {"d" : 4});
JavaScript exception in file 'client/client.js' at 1876,7: [ArangoError 1200: precondition failed]
! throw new ArangoError(requestResult);
! ^
arango> a4 = db.example.update(a2, {"e" : 5, "f" : 6 });
{ "error" : false, "_id" : "example/18612115", "_key" : "18612115", "_rev" : "19267475" }
arango> db.example.document(a4);
{ "a" : 1, "b" : 2, "c" : 3, "e" : 5, "f" : 6, "_id" : "example/18612115", "_key" : "18612115", "_rev" : "19267475" }
arango> a5 = db.example.update(a4, {"a" : 1, c : 9, e : 42 });
{ "error" : false, "_id" : "example/18612115", "_key" : "18612115", "_rev" : "19333011" }
arango> db.example.document(a5);
{ "a" : 1, "b" : 2, "c" : 9, "e" : 42, "f" : 6, "_id" : "example/18612115", "_key" : "18612115", "_rev" : "19333011" }

View File

@ -1,11 +0,0 @@
arango> db.example.save({"a" : { "one" : 1, "two" : 2, "three" : 3 }, "b" : { }});
{ "error" : false, "_id" : "example/20774803", "_key" : "20774803", "_rev" : "20774803" }
arango> db.example.update("example/20774803", {"a" : { "four" : 4 }, "b" : { "b1" : 1 }});
{ "error" : false, "_id" : "example/20774803", "_key" : "20774803", "_rev" : "21168019" }
arango> db.example.document("example/20774803");
{ "a" : { "one" : 1, "two" : 2, "three" : 3, "four" : 4 }, "b" : { "b1" : 1 }, "_id" : "example/20774803", "_key" : "20774803", "_rev" : "21168019" }
arango> db.example.update("example/20774803", { "a" : { "one" : null }, "b" : null }, false, false);
{ "error" : false, "_id" : "example/20774803", "_key" : "20774803", "_rev" : "21364627" }
arango> db.example.document("example/20774803");
{ "a" : { "two" : 2, "three" : 3, "four" : 4 }, "_id" : "example/20774803", "_key" : "20774803", "_rev" : "21364627" }

View File

@ -1,2 +0,0 @@
arango> a6 = db.example.update("example/18612115", { "x" : 1, "y" : 2 });
{ "error" : false, "_id" : "example/18612115", "_key" : "18612115", "_rev" : "19595155" }

View File

@ -1,15 +0,0 @@
arango> db.example.save({"a" : 1});
{ "error" : false, "_id" : "example/19988371", "_key" : "19988371", "_rev" : "19988371" }
arango> db.example.update("example/19988371", { "b" : null, "c" : null, "d" : 3 });
{ "error" : false, "_id" : "example/19988371", "_key" : "19988371", "_rev" : "20119443" }
arango> db.example.document("example/19988371");
{ "b" : null, "c" : null, "a" : 1, "d" : 3, "_id" : "example/19988371", "_key" : "19988371", "_rev" : "20119443" }
arango> db.example.update("example/19988371", { "a" : null }, false, false);
{ "error" : false, "_id" : "example/19988371", "_key" : "19988371", "_rev" : "20250515" }
arango> db.example.document("example/19988371");
{ "b" : null, "c" : null, "d" : 3, "_id" : "example/19988371", "_key" : "19988371", "_rev" : "20250515" }
arango> db.example.update("example/19988371", { "b" : null, "c": null, "d" : null }, false, false);
{ "error" : false, "_id" : "example/19988371", "_key" : "19988371", "_rev" : "20381587" }
arango> db.example.document("example/19988371");
{ "_id" : "example/19988371", "_key" : "19988371", "_rev" : "20381587" }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 3.0.2. */
/* A Bison parser, made by GNU Bison 3.0. */
/* Bison interface for Yacc-like parsers in C

View File

@ -5616,15 +5616,17 @@ static v8::Handle<v8::Value> JS_LookupIndexVocbaseCol (v8::Arguments const& argv
////////////////////////////////////////////////////////////////////////////////
/// @brief counts the number of documents in a result set
/// @startDocuBlock colllectionCount
/// @startDocuBlock collectionCount
/// `collection.count()`
///
/// Returns the number of living documents in the collection.
///
/// @EXAMPLES
///
/// @EXAMPLE_ARANGOSH_OUTPUT{HIER_FEHLT_DER_NAME}
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionCount}
/// ~ db._create("users");
/// db.users.count();
/// ~ db._drop("users");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// @endDocuBlock
@ -5777,29 +5779,30 @@ static v8::Handle<v8::Value> JS_DatafilesVocbaseCol (v8::Arguments const& argv)
///
/// Returns the document for a document-handle:
///
/// @code
/// arango> db.example.document("example/2873916");
/// { "_id" : "example/2873916", "_key" : "2873916", "_rev" : "2873916", "Hello" : "World" }
/// @endcode
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionName}
/// ~ db._create("example");
/// ~ var myid = db.example.save({_key: "2873916"});
/// db.example.document("example/2873916");
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// An error is raised if the document is unknown:
///
/// @code
/// arango> db.example.document("example/123456");
/// JavaScript exception in file '(arango)' at 1,12:
/// [ArangoError 1202: document not found: document not found]
/// !db.example.document("example/123456");
/// ! ^
/// @endcode
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionNameUnknown}
/// ~ db._create("example");
/// ~ var myid = db.example.save({_key: "2873916"});
/// db.example.document("example/4472917");
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// An error is raised if the handle is invalid:
///
/// @code
/// arango> db.example.document("");
/// JavaScript exception in file '(arango)' at 1,28: [ArangoError 1205: illegal document handle]
/// !db.example.document("");
/// ! ^
/// @endcode
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionNameHandle}
/// ~ db._create("example");
/// db.example.document("");
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -6036,6 +6039,7 @@ static v8::Handle<v8::Value> JS_DropIndexVocbaseCol (v8::Arguments const& argv)
///
/// As before. Instead of document a *document-handle* can be passed as
/// first argument.
///
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -6358,7 +6362,14 @@ static v8::Handle<v8::Value> JS_GetIndexesVocbaseCol (v8::Arguments const& argv)
///
/// @EXAMPLES
///
/// @verbinclude shell_collection-load
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionLoad}
/// ~ db._create("example");
/// col = db.example;
/// col.load();
/// col;
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -6519,7 +6530,7 @@ static v8::Handle<v8::Value> JS_PlanIdVocbaseCol (v8::Arguments const& argv) {
///
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionProperty}
/// ~ db._create("example");
/// db.example.properties({ waitForSync : false });
/// db.example.properties({ waitForSync : true });
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
@ -6909,8 +6920,8 @@ static v8::Handle<v8::Value> JS_RenameVocbaseCol (v8::Arguments const& argv) {
/// If there is a conflict, i. e. if the revision of the *document* does not
/// match the revision in the collection, then an error is thrown.
///
/// @FUN{@FA{collection}.replace(@FA{document}, @FA{data}, true)} or
/// @FUN{@FA{collection}.replace(@FA{document}, @FA{data}, {@FA{overwrite}: true})}
/// `collection.replace(document, data, true)` or
/// `collection.replace(document, data, overwrite: true)`
///
/// As before, but in case of a conflict, the conflict is ignored and the old
/// document is overwritten.
@ -6928,7 +6939,7 @@ static v8::Handle<v8::Value> JS_RenameVocbaseCol (v8::Arguments const& argv) {
/// applied. The *waitForSync* parameter cannot be used to disable
/// synchronization for collections that have a default *waitForSync* value
/// of *true*.
///
///m
/// `collection.replace(document-handle, data)`
///
/// As before. Instead of document a @FA{document-handle} can be passed as
@ -6938,11 +6949,24 @@ static v8::Handle<v8::Value> JS_RenameVocbaseCol (v8::Arguments const& argv) {
///
/// Create and update a document:
///
/// @TINYEXAMPLE{shell_replace-document,replacing a document}
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionReplace}
/// ~ db._create("example");
/// a1 = db.example.save({ a : 1 });
/// a2 = db.example.replace(a1, { a : 2 });
/// a3 = db.example.replace(a1, { a : 3 });
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// Use a document handle:
///
/// @TINYEXAMPLE{shell_replace-document-handle,replacing a document}
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionReplaceHandle}
/// ~ db._create("example");
/// ~ var myid = db.example.save({_key: "3903044"});
/// a1 = db.example.save({ a : 1 });
/// a2 = db.example.replace("example/3903044", { a : 2 });
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -7134,19 +7158,56 @@ static v8::Handle<v8::Value> JS_RotateVocbaseCol (v8::Arguments const& argv) {
///
/// Create and update a document:
///
/// @TINYEXAMPLE{shell_update-document,updating a document}
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionUpdate}
/// ~ db._create("example");
/// a1 = db.example.save({"a" : 1});
/// a2 = db.example.update(a1, {"b" : 2, "c" : 3});
/// a3 = db.example.update(a1, {"d" : 4});
/// a4 = db.example.update(a2, {"e" : 5, "f" : 6 });
/// db.example.document(a4);
/// a5 = db.example.update(a4, {"a" : 1, c : 9, e : 42 });
/// db.example.document(a5);
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// Use a document handle:
///
/// @TINYEXAMPLE{shell_update-document-handle,updating a document}
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionUpdateHandle}
/// ~ db._create("example");
/// ~ var myid = db.example.save({_key: "18612115"});
/// a1 = db.example.save({"a" : 1});
/// a2 = db.example.update("example/18612115", { "x" : 1, "y" : 2 });
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// Use the keepNull parameter to remove attributes with null values:
///
/// @TINYEXAMPLE{shell_update-document-keep-null,updating a document}
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionUpdateHandleKeepNull}
/// ~ db._create("example");
/// ~ var myid = db.example.save({_key: "19988371"});
/// db.example.save({"a" : 1});
/// db.example.update("example/19988371", { "b" : null, "c" : null, "d" : 3 });
/// db.example.document("example/19988371");
/// db.example.update("example/19988371", { "a" : null }, false, false);
/// db.example.document("example/19988371");
/// db.example.update("example/19988371", { "b" : null, "c": null, "d" : null }, false, false);
/// db.example.document("example/19988371");
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// Patching array values:
///
/// @TINYEXAMPLE{shell_update-document-array,updating a document}
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionUpdateHandleArray}
/// ~ db._create("example");
/// ~ var myid = db.example.save({_key: "20774803"});
/// db.example.save({"a" : { "one" : 1, "two" : 2, "three" : 3 }, "b" : { }});
/// db.example.update("example/20774803", {"a" : { "four" : 4 }, "b" : { "b1" : 1 }});
/// db.example.document("example/20774803");
/// db.example.update("example/20774803", { "a" : { "one" : null }, "b" : null }, false, false);
/// db.example.document("example/20774803");
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -7346,9 +7407,15 @@ static v8::Handle<v8::Value> SaveEdgeColCoordinator (TRI_vocbase_col_t* collecti
/// synchronization for collections that have a default *waitForSync* value
/// of *true*.
///
/// *Examples*
/// @EXAMPLES
///
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionSave}
/// ~ db._create("example");
/// db.example.save({ Hello : "World" });
/// db.example.save({ Hello : "World" }, true);
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// @verbinclude shell_create-document
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -7914,7 +7981,10 @@ static TRI_vocbase_col_t* GetCollectionFromArgument (TRI_vocbase_t* vocbase,
/// Get a collection by id:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionDatabaseNameId}
/// db._collection(26859402);
/// ~ db._create("example");
/// ~ var myid = db.example.save({_key: "12345"});
/// db._collection(12345);
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// Unknown collection:
@ -7973,7 +8043,7 @@ static v8::Handle<v8::Value> JS_CollectionVocbase (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief returns all collections
/// @startDocuBlock collectionsDatabaseName
/// @startDocuBlock collectionDatabaseNameAll
/// `db._collections()`
///
/// Returns all collections of the given database.
@ -8117,7 +8187,7 @@ static v8::Handle<v8::Value> JS_CompletionsVocbase (v8::Arguments const& argv) {
/// error is thrown. For more information on valid collection names please refer
/// to the [naming conventions](../NamingConvention/README.md).
///
/// `db._create(collection-name`, `properties)`
/// `db._create(collection-name, properties)`
///
/// *properties* must be an object with the following attributes:
///
@ -8146,7 +8216,7 @@ static v8::Handle<v8::Value> JS_CompletionsVocbase (v8::Arguments const& argv) {
///
/// * *keyOptions* (optional): additional options for key generation. If
/// specified, then *keyOptions* should be a JSON array containing the
/// following attributes (note: some of them are optional):
/// following attributes (**note**: some of them are optional):
/// * *type*: specifies the type of the key generator. The currently
/// available generators are *traditional* and *autoincrement*.
/// * *allowUserKeys*: if set to *true*, then it is allowed to supply
@ -8191,17 +8261,17 @@ static v8::Handle<v8::Value> JS_CompletionsVocbase (v8::Arguments const& argv) {
/// With defaults:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionDatabaseCreate}
/// c = db._create("cars");
/// c.properties;
/// ~ db._drop("cars");
/// c = db._create("users");
/// c.properties();
/// ~ db._drop("users");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// With properties:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionDatabaseCreateProperties}
/// c = db._create("cars", { waitForSync : true, journalSize : 1024 * 1204 });
/// c.properties;
/// ~ db._drop("cars");
/// c = db._create("users", { waitForSync : true, journalSize : 1024 * 1204 });
/// c.properties();
/// ~ db._drop("users");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// With a key generator:
@ -8314,49 +8384,36 @@ static v8::Handle<v8::Value> JS_CreateEdgeCollectionVocbase (v8::Arguments const
///
/// Remove a document:
///
/// @code
/// arango> a1 = db.example.save({ a : 1 });
/// { "_id" : "116308/4214943", "_rev" : "4214943" }
/// arango> db._remove(a1);
/// true
/// arango> db._remove(a1);
/// JavaScript exception in file '(arango)' at 1,4: [ArangoError 1202: document not found: cannot remove document]
/// !db._remove(a1);
/// ! ^
/// arango> db._remove(a1, true);
/// false
/// @endcode
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionRemove}
/// ~ db._create("example");
/// a1 = db.example.save({ a : 1 });
/// db._remove(a1);
/// db._remove(a1);
/// db._remove(a1, true);
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// Remove a document with a conflict:
///
/// @code
/// arango> a1 = db.example.save({ a : 1 });
/// { "_id" : "116308/4042634", "_rev" : "4042634" }
/// arango> a2 = db._replace(a1, { a : 2 });
/// { "_id" : "116308/4042634", "_rev" : "4108170", "_oldRev" : 4042634 }
/// arango> db._delete(a1);
/// JavaScript exception in file '(arango)' at 1,4: [ArangoError 1200: conflict: cannot delete document]
/// !db._delete(a1);
/// ! ^
/// arango> db._delete(a1, true);
/// true
/// arango> db._document(a1);
/// JavaScript exception in file '(arango)' at 1,4: [ArangoError 1202: document not found: document not found]
/// !db._document(a1);
/// ! ^
/// @endcode
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionRemoveConflict}
/// ~ db._create("example");
/// a1 = db.example.save({ a : 1 });
/// a2 = db._replace(a1, { a : 2 });
/// db._delete(a1);
/// db._delete(a1, true);
/// db._document(a1);
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// Remove a document using new signature:
/// @code
/// arangod> db.example.save({ a: 1 } );
/// {
/// "_id" : "example/11265325374",
/// "_rev" : "11265325374",
/// "_key" : "11265325374"
/// }
/// arangod> db.example.remove("example/11265325374", {overwrite: true, waitForSync: false})
/// true
/// @endcode
///
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionRemoveSignature}
/// ~ db._create("example");
/// db.example.save({ a: 1 } );
/// db.example.remove("example/11265325374", {overwrite: true, waitForSync: false})
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -8393,7 +8450,7 @@ static v8::Handle<v8::Value> JS_RemoveVocbase (v8::Arguments const& argv) {
///
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsDocumentName}
/// ~ db._create("example");
/// ~ var myid = db.example.save({_key: "12345"})
/// ~ var myid = db.example.save({_key: "12345"});
/// db._document("example/12345");
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT

View File

@ -887,15 +887,15 @@ ArangoCollection.prototype.iterate = function (iterator, options) {
///
/// `collection.removeByExample(document, waitForSync)`
///
/// The optional *waitForSync* parameter can be used to force synchronisation
/// The optional *waitForSync* parameter can be used to force synchronization
/// of the document deletion operation to disk even in case that the
/// *waitForSync* flag had been disabled for the entire collection. Thus,
/// the *waitForSync* parameter can be used to force synchronisation of just
/// the *waitForSync* parameter can be used to force synchronization of just
/// specific operations. To use this, set the *waitForSync* parameter to
/// *true*. If the *waitForSync* parameter is not specified or set to
/// *false*, then the collection's default *waitForSync* behavior is
/// applied. The *waitForSync* parameter cannot be used to disable
/// synchronisation for collections that have a default *waitForSync* value
/// synchronization for collections that have a default *waitForSync* value
/// of *true*.
///
/// `collection.removeByExample(document, waitForSync, limit)`
@ -907,9 +907,11 @@ ArangoCollection.prototype.iterate = function (iterator, options) {
///
/// @EXAMPLES
///
/// @code
/// arangod> db.content.removeByExample({ "domain": "de.celler" })
/// @endcode
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionRemoveByExample}
/// ~ db._create("example");
/// db.content.removeByExample({ "domain": "de.celler" })
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -929,15 +931,15 @@ ArangoCollection.prototype.removeByExample = function (example, waitForSync, lim
///
/// `collection.replaceByExample(document, newValue, waitForSync)`
///
/// The optional *waitForSync* parameter can be used to force synchronisation
/// The optional *waitForSync* parameter can be used to force synchronization
/// of the document replacement operation to disk even in case that the
/// *waitForSync* flag had been disabled for the entire collection. Thus,
/// the *waitForSync* parameter can be used to force synchronisation of just
/// the *waitForSync* parameter can be used to force synchronization of just
/// specific operations. To use this, set the *waitForSync* parameter to
/// *true*. If the *waitForSync* parameter is not specified or set to
/// *false*, then the collection's default *waitForSync* behavior is
/// applied. The *waitForSync* parameter cannot be used to disable
/// synchronisation for collections that have a default *waitForSync* value
/// synchronization for collections that have a default *waitForSync* value
/// of *true*.
///
/// `collection.replaceByExample(document, newValue, waitForSync, limit)`
@ -949,9 +951,11 @@ ArangoCollection.prototype.removeByExample = function (example, waitForSync, lim
///
/// @EXAMPLES
///
/// @code
/// arangod> db.content.replaceByExample({ "domain": "de.celler" }, { "foo": "someValue }, false, 5)
/// @endcode
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionReplaceByExample}
/// ~ db._create("example");
/// db.content.replaceByExample({ "domain": "de.celler" }, { "foo": "someValue }, false, 5)
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -981,12 +985,12 @@ ArangoCollection.prototype.replaceByExample = function (example, newValue, waitF
/// The optional *waitForSync* parameter can be used to force synchronization
/// of the document replacement operation to disk even in case that the
/// *waitForSync* flag had been disabled for the entire collection. Thus,
/// the *waitForSync* parameter can be used to force synchronisation of just
/// the *waitForSync* parameter can be used to force synchronization of just
/// specific operations. To use this, set the *waitForSync* parameter to
/// *true*. If the *waitForSync* parameter is not specified or set to
/// *false*, then the collection's default *waitForSync* behavior is
/// applied. The *waitForSync* parameter cannot be used to disable
/// synchronisation for collections that have a default *waitForSync* value
/// synchronization for collections that have a default *waitForSync* value
/// of *true*.
///
/// `collection.updateByExample(document, newValue, keepNull, waitForSync, limit)`
@ -998,9 +1002,11 @@ ArangoCollection.prototype.replaceByExample = function (example, newValue, waitF
///
/// @EXAMPLES
///
/// @code
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionUpdateByExample}
/// ~ db._create("example");
/// arangod> db.content.updateByExample({ "domain": "de.celler" }, { "foo": "someValue, "domain": null }, false)
/// @endcode
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
/// endDocuBlock
////////////////////////////////////////////////////////////////////////////////

View File

@ -0,0 +1,33 @@
<script id="edgeDefinitionTable.ejs" type="text/template">
<tr class="tableRow" id="row_newEdgeDefinitions<%= number%>">
<th class="collectionTh">Edge definitions*:</th>
<th class="collectionTh">
<div class="select2-container select2-container-multi" id="s2id_newEdgeDefinitions<%= number%>" style="width: 336px;"><ul class="select2-choices"> <li class="select2-search-field"> <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input select2-default" id="s2id_autogen1" style="width: 324px;"> </li></ul></div><input type="hidden" id="newEdgeDefinitions<%= number%>" value="" placeholder="Edge definitions" tabindex="-1" class="select2-offscreen">
<button id="remove_newEdgeDefinitions<%= number%>" class="graphViewer-icon-button gv_internal_remove_line gv-icon-small delete"></button>
</th><th>
<a class="modalTooltips" title="Some info for edge definitions">
<span class="arangoicon icon_arangodb_info"></span>
</a>
</th>
</tr>
<tr class="tableRow" id="row_fromCollections<%= number%>" style="display: table-row;">
<th class="collectionTh">fromCollections*:</th>
<th class="collectionTh">
<div class="select2-container select2-container-multi" id="s2id_fromCollections1" style="width: 336px;"><ul class="select2-choices"> <li class="select2-search-field"> <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" id="s2id_autogen2" style="width: 10px;"> </li></ul><div class="select2-drop select2-drop-multi select2-display-none"> <ul class="select2-results"> </ul></div></div><input type="hidden" id="fromCollections<%= number%>" value="" placeholder="" tabindex="-1" class="select2-offscreen">
</th><th>
<a class="modalTooltips" title="The collection that contain the start vertices of the relation.">
<span class="arangoicon icon_arangodb_info"></span>
</a>
</th>
</tr>
<tr class="tableRow" id="row_toCollections<%= number%>" style="display: table-row;">
<th class="collectionTh">toCollections*:</th>
<th class="collectionTh">
<div class="select2-container select2-container-multi" id="s2id_toCollections1" style="width: 336px;"><ul class="select2-choices"> <li class="select2-search-field"> <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" id="s2id_autogen3" style="width: 10px;"> </li></ul><div class="select2-drop select2-drop-multi select2-display-none"> <ul class="select2-results"> </ul></div></div><input type="hidden" id="toCollections<%= number%>" value="" placeholder="" tabindex="-1" class="select2-offscreen">
</th><th>
<a class="modalTooltips" title="The collection that contain the end vertices of the relation.">
<span class="arangoicon icon_arangodb_info"></span>
</a>
</th>
</tr>
</script>

View File

@ -0,0 +1,121 @@
<script id="modalGraphTable.ejs" type="text/template">
<%
var createTR = function(row) {
var mandatory = '';
if (row.mandatory) {
mandatory = '*';
}
%>
<tr class="tableRow" id="<%='row_' + row.id%>">
<th class="collectionTh"><%=row.label%><%=mandatory%>:</th>
<th class="collectionTh">
<%
switch(row.type) {
case "text":
%>
<input type="text" id="<%=row.id%>" value="<%=row.value||''%>" placeholder="<%=row.placeholder||''%>"></input>
<%
break;
case "password":
%>
<input type="password" id="<%=row.id%>" value="<%=row.value||''%>" placeholder="<%=row.placeholder||''%>"></input>
<%
break;
case "readonly":
%>
<div class="modal-text" id="<%=row.id%>"><%=row.value||''%></div>
<%
break;
case "checkbox":
var checked = '',
disabled = '';
if (row.checked) {
checked = 'checked';
}
if (row.disabled) {
disabled = 'disabled';
}
%>
<input type="checkbox" id="<%=row.id%>" value="<%=row.value%>" <%=checked%> <%=disabled%>></input>
<%
break;
case "select":
%>
<select id="<%=row.id%>" class="modalSelect">
<%
_.each(row.options, function(opt) {
%>
<option value="<%=opt.value%>" <%=row.selected === opt.value?"selected":""%>><%=opt.label%></option>
<%
});
%>
</select>
<%
break;
case "select2":
%>
<input type="hidden" id="<%=row.id%>" value="<%=row.value||''%>" placeholder="<%=row.placeholder||''%>"></input>
<% if (row.addDelete) {%>
<button id="<%='addAfter_' + row.id%>" class="graphViewer-icon-button gv-icon-small add"></button>
<% } %>
<% if (row.addDelete) {%>
<button id="<%='remove_' + row.id%>" class="graphViewer-icon-button gv_internal_remove_line gv-icon-small delete"></button>
<% } %>
<%
break;
}
if (row.info) {
%>
<th>
<a class="modalTooltips" title="<%=row.info%>">
<span class="arangoicon icon_arangodb_info"></span>
</a>
</th>
<%
}
%>
</tr>
<%
}//createTR
%>
<table>
<tbody>
<%
_.each(content, function(row) {
createTR(row);
});
%>
</tbody>
</table>
<%
if (advancedContent) {
%>
<div class="accordion" id="accordion2">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
<span><%=advancedContent.header%></span><span><b class="caret"></b></span>
</a>
</div>
<div id="collapseOne" class="accordion-body collapse out">
<div class="accordion-inner">
<table>
<tbody>
<%
_.each(advancedContent.content, function(row) {
createTR(row);
});
%>
</tbody>
</table>
</div>
</div>
</div>
</div>
<%
}
%>
</script>

View File

@ -55,6 +55,12 @@
case "select2":
%>
<input type="hidden" id="<%=row.id%>" value="<%=row.value||''%>" placeholder="<%=row.placeholder||''%>"></input>
<% if (row.addDelete) {%>
<button class="graphViewer-icon-button gv-icon-small add"></button>
<% } %>
<% if (row.addDelete) {%>
<button class="graphViewer-icon-button gv_internal_remove_line gv-icon-small delete"></button>
<% } %>
<%
break;
}

View File

@ -7,6 +7,7 @@
window.GraphManagementView = Backbone.View.extend({
el: '#content',
template: templateEngine.createTemplate("graphManagementView.ejs"),
edgeDefintionTemplate: templateEngine.createTemplate("edgeDefinitionTable.ejs"),
events: {
"click #deleteGraph" : "deleteGraph",
@ -19,7 +20,7 @@
addNewGraph: function(e) {
e.preventDefault();
this.createNewGraphModal2();
this.createNewGraphModal();
},
deleteGraph: function(e) {
@ -49,6 +50,7 @@
searchString : ''
}));
this.events["click .tableRow"] = this.showHideDefinition.bind(this);
this.events["click .graphViewer-icon-button"] = this.addRemoveDefintion.bind(this);
return this;
},
@ -177,7 +179,6 @@
);
}
if (!name) {
arangoHelper.arangoNotification(
"A name for the graph has to be provided."
@ -318,13 +319,32 @@
},
showHideDefinition : function(e) {
var id = $(e.currentTarget).attr("id");
if (id === "row_newEdgeDefinitions1") {
$('#row_fromCollections1').toggle();
$('#row_toCollections1').toggle();
var id = $(e.currentTarget).attr("id"), number;
if (id.indexOf("row_newEdgeDefinitions") !== -1 ) {
number = id.split("row_newEdgeDefinitions")[1];
$('#row_fromCollections' + number).toggle();
$('#row_toCollections' + number).toggle();
}
},
addRemoveDefintion : function(e) {
var id = $(e.currentTarget).attr("id");
if (id.indexOf("addAfter_newEdgeDefinitions") !== -1 ) {
//do something
$('#row_newVertexCollections').before(
this.edgeDefintionTemplate.render({
number: 100
})
);
window.modalView.delegateEvents(this.events);
return;
}
if (id.indexOf("remove_newEdgeDefinitions") !== -1 ) {
//do something
$('#row_fromCollections' + id.charAt(id.length-1)).toggle();
$('#row_toCollections' + id.charAt(id.length-1)).toggle();
}
},
createNewGraphModal2: function() {
var buttons = [],
@ -342,12 +362,14 @@
);
tableContent.push(
window.modalView.createTextEntry(
window.modalView.createSelect2Entry(
"newEdgeDefinitions1",
"Edge definitions",
"",
"Some info for edge definitions",
"Edge definitions",
true,
true,
true
)
);
@ -390,7 +412,7 @@
window.modalView.show(
"modalTable.ejs", "Add new Graph", buttons, tableContent, null, this.events
"modalGraphTable.ejs", "Add new Graph", buttons, tableContent, null, this.events
);
$('#row_fromCollections1').hide();
$('#row_toCollections1').hide();
@ -429,7 +451,7 @@
window.modalView.createDeleteButton("Delete", this.deleteGraph.bind(this))
);
window.modalView.show("modalTable.ejs", "Edit Graph", buttons, tableContent);
window.modalView.show("modalGraphTable.ejs", "Edit Graph", buttons, tableContent);
}

View File

@ -13,7 +13,8 @@
};
};
var createTextStub = function(type, label, value, info, placeholder, mandatory, regexp) {
var createTextStub = function(type, label, value, info, placeholder, mandatory, regexp,
addDelete, addAdd) {
var obj = {
type: type,
label: label
@ -30,6 +31,12 @@
if (mandatory) {
obj.mandatory = mandatory;
}
if (addDelete) {
obj.addDelete = addDelete;
}
if (addAdd) {
obj.addAdd = addAdd;
}
if (regexp){
// returns true if the string contains the match
obj.validateInput = function(el){
@ -174,8 +181,10 @@
return obj;
},
createSelect2Entry: function(id, label, value, info, placeholder, mandatory) {
var obj = createTextStub(this.tables.SELECT2, label, value, info, placeholder, mandatory);
createSelect2Entry: function(
id, label, value, info, placeholder, mandatory, addDelete, addAdd) {
var obj = createTextStub(this.tables.SELECT2, label, value, info, placeholder, mandatory,
addDelete, addAdd);
obj.id = id;
return obj;
},

View File

@ -48,6 +48,8 @@
"frontend/js/templates/modalGraph.ejs",
"frontend/js/templates/modalNewVersion.ejs",
"frontend/js/templates/modalTable.ejs",
"frontend/js/templates/modalGraphTable.ejs",
"frontend/js/templates/edgeDefinitionTable.ejs",
"frontend/js/templates/modalHotkeys.ejs",
"frontend/js/templates/navigationView.ejs",
"frontend/js/templates/dashboardView.ejs",

View File

@ -267,17 +267,21 @@ ArangoCollection.prototype.all = function () {
/// Use *toArray* to get all documents at once:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionByExample}
/// ~ db._create("users");
/// db.users.all().toArray();
/// db.users.byExample({ "id" : 323 }).toArray();
/// db.users.byExample({ "name" : "Peter" }).toArray();
/// db.users.byExample({ "name" : "Peter", "id" : 535 }).toArray();
/// ~ db._drop("users");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// Use *next* to loop over all documents:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionByExampleNext}
/// ~ db._create("users");
/// var a = db.users.byExample( {"name" : "Peter" } );
/// while (a.hasNext()) print(a.next());
/// ~ db._drop("users");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// @endDocuBlock
@ -512,7 +516,9 @@ ArangoCollection.prototype.byConditionBitarray = function (index, condition) {
/// Use *toArray* to get all documents at once:
///
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionRange}
/// l = db.skip.range("age", 10, 13).toArray();
/// ~ db._create("example");
/// l = db.example.range("age", 10, 13).toArray();
/// ~ db._drop("example")
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// @endDocuBlock
@ -886,15 +892,15 @@ ArangoCollection.prototype.iterate = function (iterator, options) {
///
/// `collection.removeByExample(document, waitForSync)`
///
/// The optional *waitForSync* parameter can be used to force synchronisation
/// The optional *waitForSync* parameter can be used to force synchronization
/// of the document deletion operation to disk even in case that the
/// *waitForSync* flag had been disabled for the entire collection. Thus,
/// the *waitForSync* parameter can be used to force synchronisation of just
/// the *waitForSync* parameter can be used to force synchronization of just
/// specific operations. To use this, set the *waitForSync* parameter to
/// *true*. If the *waitForSync* parameter is not specified or set to
/// *false*, then the collection's default *waitForSync* behavior is
/// applied. The *waitForSync* parameter cannot be used to disable
/// synchronisation for collections that have a default *waitForSync* value
/// synchronization for collections that have a default *waitForSync* value
/// of *true*.
///
/// `collection.removeByExample(document, waitForSync, limit)`
@ -906,9 +912,12 @@ ArangoCollection.prototype.iterate = function (iterator, options) {
///
/// @EXAMPLES
///
/// @code
/// arangod> db.content.removeByExample({ "domain": "de.celler" })
/// @endcode
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionRemoveByExample}
/// ~ db._create("example");
/// ~ db.example.save({ Hello : "world" });
/// db.example.removeByExample( {Hello : "world"} );
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -928,15 +937,15 @@ ArangoCollection.prototype.removeByExample = function (example, waitForSync, lim
///
/// `collection.replaceByExample(document, newValue, waitForSync)`
///
/// The optional *waitForSync* parameter can be used to force synchronisation
/// The optional *waitForSync* parameter can be used to force synchronization
/// of the document replacement operation to disk even in case that the
/// *waitForSync* flag had been disabled for the entire collection. Thus,
/// the *waitForSync* parameter can be used to force synchronisation of just
/// the *waitForSync* parameter can be used to force synchronization of just
/// specific operations. To use this, set the *waitForSync* parameter to
/// *true*. If the *waitForSync* parameter is not specified or set to
/// *false*, then the collection's default *waitForSync* behavior is
/// applied. The *waitForSync* parameter cannot be used to disable
/// synchronisation for collections that have a default *waitForSync* value
/// synchronization for collections that have a default *waitForSync* value
/// of *true*.
///
/// `collection.replaceByExample(document, newValue, waitForSync, limit)`
@ -948,9 +957,12 @@ ArangoCollection.prototype.removeByExample = function (example, waitForSync, lim
///
/// @EXAMPLES
///
/// @code
/// arangod> db.content.replaceByExample({ "domain": "de.celler" }, { "foo": "someValue }, false, 5)
/// @endcode
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionReplaceByExample}
/// ~ db._create("example");
/// ~ db.example.save({ Hello : "world" });
/// db.example.replaceByExample({ Hello: "world" }, {Hello: "mars"}, false, 5);
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -961,7 +973,7 @@ ArangoCollection.prototype.replaceByExample = function (example, newValue, waitF
////////////////////////////////////////////////////////////////////////////////
/// @brief partially updates documents matching an example
/// @startDocuBlock documentsCollectionUpdateByExample
/// `collection.updateByExample(example, newValue`
/// `collection.updateByExample(example, newValue)`
///
/// Partially updates all documents matching an example with a new document body.
/// Specific attributes in the document body of each document matching the
@ -980,12 +992,12 @@ ArangoCollection.prototype.replaceByExample = function (example, newValue, waitF
/// The optional *waitForSync* parameter can be used to force synchronization
/// of the document replacement operation to disk even in case that the
/// *waitForSync* flag had been disabled for the entire collection. Thus,
/// the *waitForSync* parameter can be used to force synchronisation of just
/// the *waitForSync* parameter can be used to force synchronization of just
/// specific operations. To use this, set the *waitForSync* parameter to
/// *true*. If the *waitForSync* parameter is not specified or set to
/// *false*, then the collection's default *waitForSync* behavior is
/// applied. The *waitForSync* parameter cannot be used to disable
/// synchronisation for collections that have a default *waitForSync* value
/// synchronization for collections that have a default *waitForSync* value
/// of *true*.
///
/// `collection.updateByExample(document, newValue, keepNull, waitForSync, limit)`
@ -997,10 +1009,13 @@ ArangoCollection.prototype.replaceByExample = function (example, newValue, waitF
///
/// @EXAMPLES
///
/// @code
/// arangod> db.content.updateByExample({ "domain": "de.celler" }, { "foo": "someValue, "domain": null }, false)
/// @endcode
/// endDocuBlock
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionUpdateByExample}
/// ~ db._create("example");
/// ~ db.example.save({ Hello : "world" });
/// db.example.updateByExample({ Hello: "world" }, { Hello: "foo", Hello: "bar" }, false);
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
ArangoCollection.prototype.updateByExample = function (example, newValue, keepNull, waitForSync, limit) {

View File

@ -423,12 +423,15 @@ AQLGenerator.prototype._edges = function(edgeExample, options) {
/// `graph_query.edges(examples)`
/// *Select all edges for the vertices selected before.*
///
///
/// Creates an AQL statement to select all edges for each of the vertices selected
/// in the step before.
/// This will include *inbound* as well as *outbound* edges.
/// The resulting set of edges can be filtered by defining one or more *examples*.
///
/// The complexity of this method is **O(n\*m^x)** with *n* being the vertices defined by the
/// parameter vertexExamplex, *m* the average amount of edges of a vertex and *x* the maximal depths.
/// Hence the default call would have a complexity of **O(n\*m)**;
///
/// *Parameter*
///
/// * *examples*: See [Definition of examples](#definition_of_examples)
@ -1710,6 +1713,7 @@ var _create = function (graphName, edgeDefinitions, orphanCollections) {
findOrCreateCollectionByName(oC, ArangoCollection.TYPE_DOCUMENT);
}
);
edgeDefinitions.forEach(
function(eD, index) {
var tmp = sortEdgeDefinition(eD);
@ -1718,7 +1722,7 @@ var _create = function (graphName, edgeDefinitions, orphanCollections) {
);
orphanCollections = orphanCollections.sort();
gdb.save({
gdb.save({
'orphanCollections' : orphanCollections,
'edgeDefinitions' : edgeDefinitions,
'_key' : graphName
@ -2686,6 +2690,9 @@ Graph.prototype._getVertexCollectionByName = function(name) {
///
/// The function accepts an id, an example, a list of examples or even an empty
/// example as parameter for vertexExample.
/// The complexity of this method is **O(n\*m^x)** with *n* being the vertices defined by the
/// parameter vertexExamplex, *m* the average amount of neighbors and *x* the maximal depths.
/// Hence the default call would have a complexity of **O(n\*m)**;
///
/// *Parameter*
///
@ -2743,6 +2750,11 @@ Graph.prototype._neighbors = function(vertexExample, options) {
/// and *graph_module._neighbors(vertex2Example, optionsVertex2)*.
/// For parameter documentation see [_neighbors](#_neighbors).
///
/// The complexity of this method is **O(n\*m^x)** with *n* being the maximal amount of vertices
/// defined by the parameters vertexExamples, *m* the average amount of neighbors and *x* the
/// maximal depths.
/// Hence the default call would have a complexity of **O(n\*m)**;
///
/// *Examples*
///
/// A route planner example, all common neighbors of capitals.
@ -2872,6 +2884,9 @@ Graph.prototype._countCommonNeighbors = function(vertex1Example, vertex2Example,
/// The function accepts an id, an example, a list of examples or even an empty
/// example as parameter for vertex1Example and vertex2Example.
///
/// The complexity of this method is **O(n)** with *n* being the maximal amount of vertices
/// defined by the parameters vertexExamples.
///
/// *Parameter*
///
/// * *vertex1Examples*: Filter the set of source vertices, see [Definition of examples](#definition_of_examples)
@ -2995,6 +3010,9 @@ Graph.prototype._countCommonProperties = function(vertex1Example, vertex2Example
///
/// This function determines all available paths in a graph.
///
/// The complexity of this method is **O(n\*n\*m)** with *n* being the amount of vertices in
/// the graph and *m* the average amount of connected edges;
///
/// *Parameters*
///
/// * *options* (optional) : An object containing options, see below:
@ -3064,6 +3082,9 @@ Graph.prototype._paths = function(options) {
/// an end vertex. The option weight allows the user to define an edge attribute
/// representing the length.
///
/// The complexity of the function is described
/// [here](../Aql/GraphOperations.html#the_complexity_of_the_shortest_path_algorithms).
///
/// *Parameters*
///
/// * *startVertexExample* (optional) : An example for the desired start Vertices
@ -3207,6 +3228,9 @@ Graph.prototype._distanceTo = function(startVertexExample, endVertexExample, opt
/// The function accepts an id, an example, a list of examples or even an empty
/// example as parameter for vertexExample.
///
/// The complexity of the function is described
/// [here](../Aql/GraphOperations.html#the_complexity_of_the_shortest_path_algorithms).
///
/// *Parameter*
///
/// * *vertexExample*: Filter the vertices, see [Definition of examples](#definition_of_examples)
@ -3289,6 +3313,9 @@ Graph.prototype._absoluteEccentricity = function(vertexExample, options) {
///
/// Similar to [_absoluteEccentricity](#_absoluteeccentricity) but returns a normalized result.
///
/// The complexity of the function is described
/// [here](../Aql/GraphOperations.html#the_complexity_of_the_shortest_path_algorithms).
///
/// @EXAMPLES
///
/// A route planner example, the eccentricity of all locations.
@ -3336,6 +3363,9 @@ Graph.prototype._eccentricity = function(options) {
/// The function accepts an id, an example, a list of examples or even an empty
/// example as parameter for *vertexExample*.
///
/// The complexity of the function is described
/// [here](../Aql/GraphOperations.html#the_complexity_of_the_shortest_path_algorithms).
///
/// *Parameter*
///
/// * *vertexExample*: Filter the vertices, see [Definition of examples](#definition_of_examples)
@ -3416,6 +3446,9 @@ Graph.prototype._absoluteCloseness = function(vertexExample, options) {
///
/// Similar to [_absoluteCloseness](#_absolutecloseness) but returns a normalized value.
///
/// The complexity of the function is described
/// [here](../Aql/GraphOperations.html#the_complexity_of_the_shortest_path_algorithms).
///
/// @EXAMPLES
///
/// A route planner example, the normalized closeness of all locations.
@ -3471,6 +3504,9 @@ Graph.prototype._closeness = function(options) {
/// [betweenness](http://en.wikipedia.org/wiki/Betweenness_centrality)
/// *of all vertices in the graph.*
///
/// The complexity of the function is described
/// [here](../Aql/GraphOperations.html#the_complexity_of_the_shortest_path_algorithms).
///
/// *Parameter*
///
/// * *options* (optional): An object defining further options. Can have the following values:
@ -3593,6 +3629,9 @@ Graph.prototype._betweenness = function(options) {
/// [radius](http://en.wikipedia.org/wiki/Eccentricity_%28graph_theory%29)
/// *of a graph.*
///
/// The complexity of the function is described
/// [here](../Aql/GraphOperations.html#the_complexity_of_the_shortest_path_algorithms).
///
/// *Parameter*
///
/// * *options* (optional): An object defining further options. Can have the following values:
@ -3662,6 +3701,9 @@ Graph.prototype._radius = function(options) {
/// [diameter](http://en.wikipedia.org/wiki/Eccentricity_%28graph_theory%29)
/// *of a graph.*
///
/// The complexity of the function is described
/// [here](../Aql/GraphOperations.html#the_complexity_of_the_shortest_path_algorithms).
///
/// *Parameter*
///
/// * *options* (optional): An object defining further options. Can have the following values:

View File

@ -4345,10 +4345,13 @@ function GRAPH_PATHS (vertices, edgeCollection, direction, followCycles, minLeng
/// `GRAPH_PATHS (graphName, options)`
/// *The GRAPH\_PATHS function returns all paths of a graph.*
///
/// The complexity of this method is **O(n\*n\*m)** with *n* being the amount of vertices in
/// the graph and *m* the average amount of connected edges;
///
/// *Parameters*
///
/// * *graphName* : The name of the graph as a string.
/// * *options* : An object containing options, see below:
/// * *options* : An object containing the following options::
/// * *direction* : The direction of the edges. Possible values are *any*,
/// *inbound* and *outbound* (default).
/// * *followCycles* (optional) : If set to *true* the query follows cycles in the graph,
@ -5250,6 +5253,9 @@ function IS_EXAMPLE_SET (example) {
/// an end vertex. The option weight allows the user to define an edge attribute
/// representing the length.
///
/// The complexity of the function is described
/// [here](#the_complexity_of_the_shortest_path_algorithms).
///
/// *Parameters*
///
/// * *graphName* : The name of the graph as a string.
@ -5257,7 +5263,7 @@ function IS_EXAMPLE_SET (example) {
/// (see [example](#short_explaination_of_the_vertex_example_parameter)).
/// * *endVertexExample* : An example for the desired
/// end Vertices (see [example](#short_explaination_of_the_vertex_example_parameter)).
/// * *options* (optional) : An object containing options, see below:
/// * *options* (optional) : An object containing the following options::
/// * *direction* : The direction of the edges as a string.
/// Possible values are *outbound*, *inbound* and *any* (default).
/// * *edgeCollectionRestriction* : One or multiple edge
@ -5380,6 +5386,8 @@ function GRAPH_TRAVERSAL (vertexCollection,
/// For a more detailed documentation on the optional parameters see
/// [Traversals](../Traversals/README.md).
///
/// The complexity of this function strongly depends on the usage.
///
/// *Parameters*
/// * *graphName* : The name of the graph as a string.
/// * *startVertex* : The ID of the start vertex of the traversal as a string.
@ -5559,6 +5567,8 @@ function GENERAL_GRAPH_DISTANCE_TO (graphName,
/// For a more detailed documentation on the optional parameters see
/// [Traversals](../Traversals/README.md).
///
/// The complexity of this function strongly depends on the usage.
///
/// *Parameters*
///
/// * *graphName* : The name of the graph as a string.
@ -5717,13 +5727,16 @@ function GRAPH_NEIGHBORS (vertexCollection,
///
/// By default only the direct neighbors (path length equals 1) are returned, but one can define
/// the range of the path length to the neighbors with the options *minDepth* and *maxDepth*.
/// The complexity of this method is **O(n\*m^x)** with *n* being the vertices defined by the
/// parameter vertexExamplex, *m* the average amount of neighbors and *x* the maximal depths.
/// Hence the default call would have a complexity of **O(n\*m)**;
///
/// *Parameters*
///
/// * *graphName* : The name of the graph as a string.
/// * *vertexExample* : An example for the desired
/// vertices (see [example](#short_explaination_of_the_vertex_example_parameter)).
/// * *options* : An object containing options, see below:
/// * *options* : An object containing the following options::
/// * *direction* : The direction
/// of the edges. Possible values are *outbound*, *inbound* and *any* (default).
/// * *edgeExamples* : A filter example for the edges to
@ -5830,13 +5843,17 @@ function GENERAL_GRAPH_NEIGHBORS (graphName,
/// `GRAPH_EDGES (graphName, vertexExample, options)`
/// *The GRAPH\_EDGES function returns all edges of the graph connected to the vertices
/// defined by the example.*
/// The complexity of this method is **O(n\*m^x)** with *n* being the vertices defined by the
/// parameter vertexExamplex, *m* the average amount of edges of a vertex and *x* the maximal
/// depths.
/// Hence the default call would have a complexity of **O(n\*m)**;
///
/// *Parameters*
///
/// * *graphName* : The name of the graph as a string.
/// * *vertexExample* : An example for the desired
/// vertices (see [example](#short_explaination_of_the_vertex_example_parameter)).
/// * *options* (optional) : An object containing options, see below:
/// * *options* (optional) : An object containing the following options::
/// * *direction* : The direction
/// of the edges as a string. Possible values are *outbound*, *inbound* and *any* (default).
/// * *edgeCollectionRestriction* : One or multiple edge
@ -5911,14 +5928,14 @@ function GENERAL_GRAPH_EDGES (
/// *The GRAPH\_VERTICES function returns all vertices.*
///
/// According to the optional filters it will only return vertices that have
/// outbound, onbound or any (default) edges.
/// outbound, inbound or any (default) edges.
///
/// *Parameters*
///
/// * *graphName* : The name of the graph as a string.
/// * *vertexExample* : An example for the desired
/// vertices (see [example](#short_explaination_of_the_vertex_example_parameter)).
/// * *options* (optional) : An object containing options, see below:
/// * *options* (optional) : An object containing the following options::
/// * *direction* : The direction of the edges as a string. Possible values are
/// *outbound*, *inbound* and *any* (default).
/// * *vertexCollectionRestriction* : One or multiple
@ -6005,6 +6022,11 @@ function TRANSFER_GENERAL_GRAPH_NEIGHBORS_RESULT (result) {
///
/// This function returns the intersection of *GRAPH_NEIGHBORS(vertex1Example, optionsVertex1)*
/// and *GRAPH_NEIGHBORS(vertex2Example, optionsVertex2)*.
/// The complexity of this method is **O(n\*m^x)** with *n* being the maximal amount of vertices
/// defined by the parameters vertexExamples, *m* the average amount of neighbors and *x* the
/// maximal depths.
/// Hence the default call would have a complexity of **O(n\*m)**;
///
/// For parameter documentation read the documentation of
/// [GRAPH_NEIGHBORS](#graph_neighbors).
///
@ -6097,8 +6119,13 @@ function GENERAL_GRAPH_COMMON_NEIGHBORS (
/// @startDocuBlock JSF_ahuacatl_general_graph_common_properties
///
/// `GRAPH_COMMON_PROPERTIES (graphName, vertex1Example, vertex2Examples, options)`
/// *The GRAPH\_COMMON\_PROPERTIES function returns all vertices
/// defined by the examples that share common properties
/// *The GRAPH\_COMMON\_PROPERTIES function returns a list of objects which have the id of
/// the vertices defined by *vertex1Example* as keys and a list of vertices defined by
/// *vertex21Example*, that share common properties as value. Notice that only the
/// vertex id and the matching attributes are returned in the result.
///
/// The complexity of this method is **O(n)** with *n* being the maximal amount of vertices
/// defined by the parameters vertexExamples.
///
/// *Parameters*
///
@ -6107,7 +6134,7 @@ function GENERAL_GRAPH_COMMON_NEIGHBORS (
/// vertices (see [example](#short_explaination_of_the_vertex_example_parameter)).
/// * *vertex2Example* : An example for the desired
/// vertices (see [example](#short_explaination_of_the_vertex_example_parameter)).
/// * *options* (optional) : An object containing options, see below:
/// * *options* (optional) : An object containing the following options::
/// * *vertex1CollectionRestriction* : One or multiple vertex
/// collection names. Only vertices from these collections will be considered.
/// * *vertex2CollectionRestriction* : One or multiple vertex
@ -6236,12 +6263,15 @@ function GENERAL_GRAPH_COMMON_PROPERTIES (
/// [eccentricity](http://en.wikipedia.org/wiki/Distance_%28graph_theory%29)
/// of the vertices defined by the examples.*
///
/// The complexity of the function is described
/// [here](#the_complexity_of_the_shortest_path_algorithms).
///
/// *Parameters*
///
/// * *graphName* : The name of the graph as a string.
/// * *vertexExample* : An example for the desired
/// vertices (see [example](#short_explaination_of_the_vertex_example_parameter)).
/// * *options* (optional) : An object containing options, see below:
/// * *options* (optional) : An object containing the following options::
/// * *direction* : The direction of the edges as a string.
/// Possible values are *outbound*, *inbound* and *any* (default).
/// * *edgeCollectionRestriction* : One or multiple edge
@ -6337,10 +6367,13 @@ function GENERAL_GRAPH_ABSOLUTE_ECCENTRICITY (graphName, vertexExample, options)
/// [eccentricity](http://en.wikipedia.org/wiki/Distance_%28graph_theory%29)
/// of the graphs vertices*
///
/// The complexity of the function is described
/// [here](#the_complexity_of_the_shortest_path_algorithms).
///
/// *Parameters*
///
/// * *graphName* : The name of the graph as a string.
/// * *options* (optional) : An object containing options, see below:
/// * *options* (optional) : An object containing the following options::
/// * *direction* : The direction of the edges as a string.
/// Possible values are *outbound*, *inbound* and *any* (default).
/// * *algorithm* : The algorithm to calculate the shortest paths as a string. Possible
@ -6412,12 +6445,15 @@ function GENERAL_GRAPH_ECCENTRICITY (graphName, options) {
/// [closeness](http://en.wikipedia.org/wiki/Centrality#Closeness_centrality)
/// of the vertices defined by the examples.*
///
/// The complexity of the function is described
/// [here](#the_complexity_of_the_shortest_path_algorithms).
///
/// *Parameters*
///
/// * *graphName* : The name of the graph as a string.
/// * *vertexExample* : An example for the desired
/// vertices (see [example](#short_explaination_of_the_vertex_example_parameter)).
/// * *options* : An object containing options, see below:
/// * *options* : An object containing the following options::
/// * *direction* : The direction of the edges.
/// Possible values are *outbound*, *inbound* and *any* (default).
/// * *edgeCollectionRestriction* : One or multiple edge
@ -6513,10 +6549,13 @@ function GENERAL_GRAPH_ABSOLUTE_CLOSENESS (graphName, vertexExample, options) {
/// [closeness](http://en.wikipedia.org/wiki/Centrality#Closeness_centrality)
/// of graphs vertices.*
///
/// The complexity of the function is described
/// [here](#the_complexity_of_the_shortest_path_algorithms).
///
/// *Parameters*
///
/// * *graphName* : The name of the graph as a string.
/// * *options* : An object containing options, see below:
/// * *options* : An object containing the following options::
/// * *direction* : The direction of the edges.
/// Possible values are *outbound*, *inbound* and *any* (default).
/// * *algorithm* : The algorithm to calculate
@ -6607,9 +6646,12 @@ function GENERAL_GRAPH_CLOSENESS (graphName, options) {
/// [betweenness](http://en.wikipedia.org/wiki/Betweenness_centrality)
/// of all vertices in the graph.*
///
/// The complexity of the function is described
/// [here](#the_complexity_of_the_shortest_path_algorithms).
///
///
/// * *graphName* : The name of the graph as a string.
/// * *options* : An object containing options, see below:
/// * *options* : An object containing the following options::
/// * *direction* : The direction of the edges.
/// Possible values are *outbound*, *inbound* and *any* (default).
/// * *weight* : The name of the attribute of
@ -6711,10 +6753,13 @@ function GENERAL_GRAPH_ABSOLUTE_BETWEENNESS (graphName, options) {
/// [betweenness](http://en.wikipedia.org/wiki/Betweenness_centrality)
/// of graphs vertices.*
///
/// The complexity of the function is described
/// [here](#the_complexity_of_the_shortest_path_algorithms).
///
/// *Parameters*
///
/// * *graphName* : The name of the graph as a string.
/// * *options* : An object containing options, see below:
/// * *options* : An object containing the following options::
/// * *direction* : The direction of the edges.
/// Possible values are *outbound*, *inbound* and *any* (default).
/// * *weight* : The name of the attribute of
@ -6791,8 +6836,11 @@ function GENERAL_GRAPH_BETWEENNESS (graphName, options) {
/// [radius](http://en.wikipedia.org/wiki/Eccentricity_%28graph_theory%29)
/// of a graph.*
///
/// The complexity of the function is described
/// [here](#the_complexity_of_the_shortest_path_algorithms).
///
/// * *graphName* : The name of the graph as a string.
/// * *options* : An object containing options, see below:
/// * *options* : An object containing the following options::
/// * *direction* : The direction of the edges.
/// Possible values are *outbound*, *inbound* and *any* (default).
/// * *algorithm* : The algorithm to calculate the shortest paths as a string. Possible
@ -6878,10 +6926,13 @@ function GENERAL_GRAPH_RADIUS (graphName, options) {
/// [diameter](http://en.wikipedia.org/wiki/Eccentricity_%28graph_theory%29)
/// of a graph.*
///
/// The complexity of the function is described
/// [here](#the_complexity_of_the_shortest_path_algorithms).
///
/// *Parameters*
///
/// * *graphName* : The name of the graph as a string.
/// * *options* : An object containing options, see below:
/// * *options* : An object containing the following options::
/// * *direction* : The direction of the edges.
/// Possible values are *outbound*, *inbound* and *any* (default).
/// * *algorithm* : The algorithm to calculate the shortest paths as a string. Possible

View File

@ -364,13 +364,16 @@ ArangoCollection.prototype.any = function () {
///
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionFirst}
/// ~ db._create("example");
/// db.example.first(1)
/// ~ db.example.save({ Hello : "world" });
/// ~ db.example.save({ Foo : "bar" });
/// db.example.first(1);
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionFirstNull}
/// ~ db._create("example");
/// arangod> db.example.first()
/// ~ db.example.save({ Hello : "world" });
/// db.example.first();
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
/// @endDocuBlock
@ -441,20 +444,26 @@ ArangoCollection.prototype.first = function (count) {
/// collection. If the collection does not contain any documents, the result
/// returned is *null*.
///
/// Note: this method is not supported in sharded collections with more than
/// **Note**: this method is not supported in sharded collections with more than
/// one shard.
///
/// *Examples*
/// @EXAMPLES
///
/// @code
/// arangod> db.example.last(1)
/// [ { "_id" : "example/222716379559", "_rev" : "222716379559", "Hello" : "World" } ]
/// @endcode
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionLast}
/// ~ db._create("example");
/// ~ db.example.save({ Hello : "world" });
/// ~ db.example.save({ Foo : "bar" });
/// db.example.last(2);
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionLastNull}
/// ~ db._create("example");
/// ~ db.example.save({ Hello : "world" });
/// db.example.last(1);
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// @code
/// arangod> db.example.last()
/// { "_id" : "example/222716379559", "_rev" : "222716379559", "Hello" : "World" }
/// @endcode
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -510,7 +519,7 @@ ArangoCollection.prototype.last = function (count) {
///
/// Returns the first document of a collection that matches the specified
/// example or *null*. The example must be specified as paths and values.
/// See @FN{byExample} for details.
/// See *byExample* for details.
///
/// `collection.firstExample(path1, value1, ...)`
///
@ -519,7 +528,10 @@ ArangoCollection.prototype.last = function (count) {
/// @EXAMPLES
///
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionFirstExample}
/// ~ db._create("users");
/// ~ db.users.save("Foo");
/// db.users.firstExample("name", 1237);
/// ~ db._drop("users");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// @endDocuBlock

View File

@ -214,7 +214,7 @@ ArangoDatabase.prototype._executeTransaction = function (data) {
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionDatabaseDrop}
/// ~ db._create("example");
/// col = db.example;
/// db._drop(col)
/// db._drop(col);
/// col;
/// ~ db._drop("example");
/// @END_EXAMPLE_ARANGOSH_OUTPUT