diff --git a/arangod/Ahuacatl/ahuacatl-functions.cpp b/arangod/Ahuacatl/ahuacatl-functions.cpp index 93d5a5a697..702abbb8b2 100644 --- a/arangod/Ahuacatl/ahuacatl-functions.cpp +++ b/arangod/Ahuacatl/ahuacatl-functions.cpp @@ -664,9 +664,9 @@ TRI_associative_pointer_t* TRI_CreateFunctionsAql (void) { REGISTER_FUNCTION("GRAPH_SHORTEST_PATH", "GENERAL_GRAPH_SHORTEST_PATH", false, false, "s,als,als|a", NULL); REGISTER_FUNCTION("GRAPH_DISTANCE_TO", "GENERAL_GRAPH_DISTANCE_TO", false, false, "s,als,als|a", NULL); REGISTER_FUNCTION("TRAVERSAL", "GRAPH_TRAVERSAL", false, false, "h,h,s,s|a", NULL); - REGISTER_FUNCTION("GRAPH_TRAVERSAL", "GENERAL_GRAPH_TRAVERSAL", false, false, "s,s,s|a", NULL); + REGISTER_FUNCTION("GRAPH_TRAVERSAL", "GENERAL_GRAPH_TRAVERSAL", false, false, "s,als,s|a", NULL); REGISTER_FUNCTION("TRAVERSAL_TREE", "GRAPH_TRAVERSAL_TREE", false, false, "h,h,s,s,s|a", NULL); - REGISTER_FUNCTION("GRAPH_TRAVERSAL_TREE", "GENERAL_GRAPH_TRAVERSAL_TREE", false, false, "s,s,s,s|a", NULL); + REGISTER_FUNCTION("GRAPH_TRAVERSAL_TREE", "GENERAL_GRAPH_TRAVERSAL_TREE", false, false, "s,als,s,s|a", NULL); REGISTER_FUNCTION("EDGES", "GRAPH_EDGES", false, false, "h,s,s|l", NULL); REGISTER_FUNCTION("GRAPH_EDGES", "GENERAL_GRAPH_EDGES", false, false, "s,als|a", NULL); REGISTER_FUNCTION("GRAPH_VERTICES", "GENERAL_GRAPH_VERTICES", false, false, "s,als|a", NULL); diff --git a/js/apps/system/aardvark/frontend/js/modules/org/arangodb/arango-collection-common.js b/js/apps/system/aardvark/frontend/js/modules/org/arangodb/arango-collection-common.js index 4b0d0a81f6..a8dc22043a 100644 --- a/js/apps/system/aardvark/frontend/js/modules/org/arangodb/arango-collection-common.js +++ b/js/apps/system/aardvark/frontend/js/modules/org/arangodb/arango-collection-common.js @@ -268,17 +268,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 @@ -513,7 +517,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 @@ -693,12 +699,17 @@ ArangoCollection.prototype.geo = function(loc, order) { /// /// To get the nearst two locations: /// -/// @TINYEXAMPLE{simple-query-near,nearest two location} +/// @EXAMPLE_ARANGOSH_OUTPUT{collectionNear} +/// db.geo.near(0,0).limit(2).toArray(); +/// @END_EXAMPLE_ARANGOSH_OUTPUT /// /// If you need the distance as well, then you can use the *distance* /// operator: /// -/// @TINYEXAMPLE{simple-query-near2,nearest two location with distance in meter} +/// @EXAMPLE_ARANGOSH_OUTPUT{collectionNearDistance} +/// db.geo.near(0,0).distance().limit(2).toArray(); +/// @END_EXAMPLE_ARANGOSH_OUTPUT +/// /// @endDocuBlock //////////////////////////////////////////////////////////////////////////////// @@ -734,7 +745,10 @@ ArangoCollection.prototype.near = function (lat, lon) { /// /// To find all documents within a radius of 2000 km use: /// -/// @TINYEXAMPLE{simple-query-within,within a radius} +/// @EXAMPLE_ARANGOSH_OUTPUT{collectionWithin} +/// db.geo.within(0, 0, 2000 * 1000).distance().toArray(); +/// @END_EXAMPLE_ARANGOSH_OUTPUT +/// /// @endDocuBlock //////////////////////////////////////////////////////////////////////////////// @@ -750,7 +764,7 @@ ArangoCollection.prototype.within = function (lat, lon, radius) { /// This will find the documents from the collection's fulltext index that match the search /// query. /// -/// In order to use the @FN{fulltext} operator, a fulltext index must be defined for the +/// In order to use the *fulltext* operator, a fulltext index must be defined for the /// collection, for the specified attribute. If multiple fulltext indexes are defined /// for the collection and attribute, the most capable one will be selected. /// @@ -758,7 +772,9 @@ ArangoCollection.prototype.within = function (lat, lon, radius) { /// /// To find all documents which contain the terms *text* and *word*: /// -/// @TINYEXAMPLE{simple-query-fulltext,complete match query} +/// @EXAMPLE_ARANGOSH_OUTPUT{collectionFulltext} +/// db.emails.fulltext("text", "word").toArray(); +/// @END_EXAMPLE_ARANGOSH_OUTPUT /// @endDocuBlock //////////////////////////////////////////////////////////////////////////////// @@ -909,7 +925,8 @@ ArangoCollection.prototype.iterate = function (iterator, options) { /// /// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionRemoveByExample} /// ~ db._create("example"); -/// db.content.removeByExample({ "domain": "de.celler" }) +/// ~ db.example.save({ Hello : "world" }); +/// db.example.removeByExample( {Hello : "world"} ); /// ~ db._drop("example"); /// @END_EXAMPLE_ARANGOSH_OUTPUT /// @endDocuBlock @@ -953,7 +970,8 @@ ArangoCollection.prototype.removeByExample = function (example, waitForSync, lim /// /// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionReplaceByExample} /// ~ db._create("example"); -/// db.content.replaceByExample({ "domain": "de.celler" }, { "foo": "someValue }, false, 5) +/// ~ db.example.save({ Hello : "world" }); +/// db.example.replaceByExample({ Hello: "world" }, {Hello: "mars"}, false, 5); /// ~ db._drop("example"); /// @END_EXAMPLE_ARANGOSH_OUTPUT /// @endDocuBlock @@ -966,7 +984,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 @@ -1004,10 +1022,11 @@ ArangoCollection.prototype.replaceByExample = function (example, newValue, waitF /// /// @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionUpdateByExample} /// ~ db._create("example"); -/// arangod> db.content.updateByExample({ "domain": "de.celler" }, { "foo": "someValue, "domain": null }, false) +/// ~ db.example.save({ Hello : "world" }); +/// db.example.updateByExample({ Hello: "world" }, { Hello: "foo", Hello: "bar" }, false); /// ~ db._drop("example"); /// @END_EXAMPLE_ARANGOSH_OUTPUT -/// endDocuBlock +/// @endDocuBlock //////////////////////////////////////////////////////////////////////////////// ArangoCollection.prototype.updateByExample = function (example, newValue, keepNull, waitForSync, limit) { diff --git a/js/apps/system/aardvark/frontend/js/modules/org/arangodb/simple-query-common.js b/js/apps/system/aardvark/frontend/js/modules/org/arangodb/simple-query-common.js index dfbd7fa298..87b9baa081 100644 --- a/js/apps/system/aardvark/frontend/js/modules/org/arangodb/simple-query-common.js +++ b/js/apps/system/aardvark/frontend/js/modules/org/arangodb/simple-query-common.js @@ -314,27 +314,31 @@ SimpleQuery.prototype.clone = function () { //////////////////////////////////////////////////////////////////////////////// /// @brief executes a query +/// @startDocuBlock queryExecute +/// `query.execute(batchSize)` /// -/// @FUN{@FA{query}.execute(@FA{batchSize})} +/// Executes a simple query. If the optional batchSize value is specified, +/// the server will return at most batchSize values in one roundtrip. +/// The batchSize cannot be adjusted after the query is first executed. /// -/// Executes a simple query. If the optional @FA{batchSize} value is specified, -/// the server will return at most @FN{batchSize} values in one roundtrip. -/// The @FA{batchSize} cannot be adjusted after the query is first executed. -/// -/// Note that there is no need to explicitly call the execute method if another +/// **Note**: There is no need to explicitly call the execute method if another /// means of fetching the query results is chosen. The following two approaches /// lead to the same result: -/// @code +/// +/// @EXAMPLE_ARANGOSH_OUTPUT{executeQuery} /// result = db.users.all().toArray(); /// q = db.users.all(); q.execute(); result = [ ]; while (q.hasNext()) { result.push(q.next()); } -/// @endcode +/// @END_EXAMPLE_ARANGOSH_OUTPUT /// -/// The following two alternatives both use a @FA{batchSize} and return the same +/// The following two alternatives both use a batchSize and return the same /// result: -/// @code +/// +/// @EXAMPLE_ARANGOSH_OUTPUT{executeQueryBatchSize} /// q = db.users.all(); q.setBatchSize(20); q.execute(); while (q.hasNext()) { print(q.next()); } /// q = db.users.all(); q.execute(20); while (q.hasNext()) { print(q.next()); } -/// @endcode +/// @END_EXAMPLE_ARANGOSH_OUTPUT +/// +/// @endDocuBlock //////////////////////////////////////////////////////////////////////////////// SimpleQuery.prototype.execute = function () { @@ -356,19 +360,21 @@ SimpleQuery.prototype.execute = function () { //////////////////////////////////////////////////////////////////////////////// /// @brief limit +/// @startDocuBlock queryLimit +/// `query.limit(number)` /// -/// @FUN{@FA{query}.limit(@FA{number})} -/// -/// Limits a result to the first @FA{number} documents. Specifying a limit of -/// @LIT{0} returns no documents at all. If you do not need a limit, just do +/// Limits a result to the first *number* documents. Specifying a limit of +/// *0* returns no documents at all. If you do not need a limit, just do /// not add the limit operator. The limit must be non-negative. /// -/// In general the input to @FN{limit} should be sorted. Otherwise it will be +/// In general the input to *limit* should be sorted. Otherwise it will be /// unclear which documents are used in the result set. /// -/// *Examples* +/// @EXAMPLES /// /// @verbinclude simple2 +/// +/// @endDocuBlock //////////////////////////////////////////////////////////////////////////////// SimpleQuery.prototype.limit = function (limit) { @@ -388,20 +394,22 @@ SimpleQuery.prototype.limit = function (limit) { //////////////////////////////////////////////////////////////////////////////// /// @brief skip +/// @startDocuBlock queySkip +/// `query.skip(number)` /// -/// @FUN{@FA{query}.skip(@FA{number})} -/// -/// Skips the first @FA{number} documents. If @FA{number} is positive, then skip -/// the number of documents. If @FA{number} is negative, then the total amount N +/// Skips the first *number* documents. If *number* is positive, then skip +/// the number of documents. If *number* is negative, then the total amount N /// of documents must be known and the results starts at position (N + -/// @FA{number}). +/// *number*). /// -/// In general the input to @FN{limit} should be sorted. Otherwise it will be +/// In general the input to *limit* should be sorted. Otherwise it will be /// unclear which documents are used in the result set. /// -/// *Examples* +/// @EXAMPLES /// /// @verbinclude simple8 +/// +/// @endDocuBlock //////////////////////////////////////////////////////////////////////////////// SimpleQuery.prototype.skip = function (skip) { @@ -460,11 +468,12 @@ SimpleQuery.prototype.toArray = function () { //////////////////////////////////////////////////////////////////////////////// /// @brief returns the batch size -/// -/// @FUN{@FA{cursor}.getBatchSize()} +/// @startDocuBlock cursorGetBatchSize +/// `cursor.getBatchSize()` /// /// Returns the batch size for queries. If the returned value is undefined, the /// server will determine a sensible batch size for any following requests. +/// @endDocuBlock //////////////////////////////////////////////////////////////////////////////// SimpleQuery.prototype.getBatchSize = function () { @@ -473,11 +482,12 @@ SimpleQuery.prototype.getBatchSize = function () { //////////////////////////////////////////////////////////////////////////////// /// @brief sets the batch size for any following requests -/// -/// @FUN{@FA{cursor}.setBatchSize(@FA{number})} +/// @startDocuBlock cursorSetBatchSize +/// `cursor.setBatchSize(number)` /// /// Sets the batch size for queries. The batch size determines how many results /// are at most transferred from the server to the client in one chunk. +/// @endDocuBlock //////////////////////////////////////////////////////////////////////////////// SimpleQuery.prototype.setBatchSize = function (value) { @@ -488,27 +498,27 @@ SimpleQuery.prototype.setBatchSize = function (value) { //////////////////////////////////////////////////////////////////////////////// /// @brief counts the number of documents +/// @startDocuBlock cursorCount +/// `cursor.count()` /// -/// @FUN{@FA{cursor}.count()} -/// -/// The @FN{count} operator counts the number of document in the result set and -/// returns that number. The @FN{count} operator ignores any limits and returns +/// The *count* operator counts the number of document in the result set and +/// returns that number. The *count* operator ignores any limits and returns /// the total number of documents found. /// -/// @note Not all simple queries support counting. In this case @LIT{null} is +/// **Note**: Not all simple queries support counting. In this case *null* is /// returned. /// -/// @FUN{@FA{cursor}.count(@LIT{true})} +/// `cursor.count(true)` /// -/// If the result set was limited by the @FN{limit} operator or documents were -/// skiped using the @FN{skip} operator, the @FN{count} operator with argument -/// @LIT{true} will use the number of elements in the final result set - after -/// applying @FN{limit} and @FN{skip}. +/// If the result set was limited by the *limit* operator or documents were +/// skiped using the *skip* operator, the *count* operator with argument +/// *true* will use the number of elements in the final result set - after +/// applying *limit* and *skip*. /// -/// @note Not all simple queries support counting. In this case @LIT{null} is +/// **Note**: Not all simple queries support counting. In this case *null* is /// returned. /// -/// *Examples* +/// @EXAMPLES /// /// Ignore any limit: /// @@ -517,6 +527,8 @@ SimpleQuery.prototype.setBatchSize = function (value) { /// Counting any limit or skip: /// /// @verbinclude simple10 +/// +/// @endDocuBlock //////////////////////////////////////////////////////////////////////////////// SimpleQuery.prototype.count = function (applyPagination) { @@ -531,16 +543,17 @@ SimpleQuery.prototype.count = function (applyPagination) { //////////////////////////////////////////////////////////////////////////////// /// @brief checks if the cursor is exhausted +/// @startDocuBlock cursorHasNext +/// `cursor.hasNext()` /// -/// @FUN{@FA{cursor}.hasNext()} +/// The *hasNext* operator returns *true*, then the cursor still has +/// documents. In this case the next document can be accessed using the +/// *next* operator, which will advance the cursor. /// -/// The @FN{hasNext} operator returns @LIT{true}, then the cursor still has -/// documents. In this case the next document can be accessed using the -/// @FN{next} operator, which will advance the cursor. -/// -/// *Examples* +/// @EXAMPLES /// /// @verbinclude simple7 +/// @endDocuBlock //////////////////////////////////////////////////////////////////////////////// SimpleQuery.prototype.hasNext = function () { @@ -551,18 +564,19 @@ SimpleQuery.prototype.hasNext = function () { //////////////////////////////////////////////////////////////////////////////// /// @brief returns the next result document +/// @startDocuBlock cursorNext +/// `cursor.next()` /// -/// @FUN{@FA{cursor}.next()} -/// -/// If the @FN{hasNext} operator returns @LIT{true}, then the underlying +/// If the *hasNext* operator returns *true*, then the underlying /// cursor of the simple query still has documents. In this case the -/// next document can be accessed using the @FN{next} operator, which -/// will advance the underlying cursor. If you use @FN{next} on an -/// exhausted cursor, then @LIT{undefined} is returned. +/// next document can be accessed using the *next* operator, which +/// will advance the underlying cursor. If you use *next* on an +/// exhausted cursor, then *undefined* is returned. /// -/// *Examples* +/// @EXAMPLES /// /// @verbinclude simple5 +/// @endDocuBlock //////////////////////////////////////////////////////////////////////////////// SimpleQuery.prototype.next = function () { @@ -573,12 +587,13 @@ SimpleQuery.prototype.next = function () { //////////////////////////////////////////////////////////////////////////////// /// @brief disposes the result -/// -/// @FUN{@FA{cursor}.dispose()} +/// @startDocuBlock cursorDispose +/// `cursor.dispose()` /// /// If you are no longer interested in any further results, you should call -/// @FN{dispose} in order to free any resources associated with the cursor. -/// After calling @FN{dispose} you can no longer access the cursor. +/// *dispose* in order to free any resources associated with the cursor. +/// After calling *dispose* you can no longer access the cursor. +/// @endDocuBlock //////////////////////////////////////////////////////////////////////////////// SimpleQuery.prototype.dispose = function() { diff --git a/js/apps/system/aardvark/frontend/js/routers/router.js b/js/apps/system/aardvark/frontend/js/routers/router.js index 5cbbf072f7..e78668ea82 100644 --- a/js/apps/system/aardvark/frontend/js/routers/router.js +++ b/js/apps/system/aardvark/frontend/js/routers/router.js @@ -233,7 +233,7 @@ new window.GraphManagementView( { collection: new window.GraphCollection(), - collectionCollection: new window.arangoCollections() + collectionCollection: this.arangoCollectionsStore } ); } diff --git a/js/apps/system/aardvark/frontend/js/templates/edgeDefinitionTable.ejs b/js/apps/system/aardvark/frontend/js/templates/edgeDefinitionTable.ejs index 664720ad33..5b40d504b2 100644 --- a/js/apps/system/aardvark/frontend/js/templates/edgeDefinitionTable.ejs +++ b/js/apps/system/aardvark/frontend/js/templates/edgeDefinitionTable.ejs @@ -2,7 +2,7 @@ Edge definitions*: - + @@ -13,7 +13,7 @@ fromCollections*: - + @@ -23,7 +23,7 @@ toCollections*: - + diff --git a/js/apps/system/aardvark/frontend/js/templates/modalGraphTable.ejs b/js/apps/system/aardvark/frontend/js/templates/modalGraphTable.ejs index 6a5f1779d9..9bd000af6a 100644 --- a/js/apps/system/aardvark/frontend/js/templates/modalGraphTable.ejs +++ b/js/apps/system/aardvark/frontend/js/templates/modalGraphTable.ejs @@ -1,10 +1,15 @@