From 8f3779b1eb2a1f99f6f51aa29180795a4d17e92f Mon Sep 17 00:00:00 2001 From: scottashton Date: Tue, 18 Nov 2014 09:42:17 +0100 Subject: [PATCH] added maxIterations param to GRAPH_EDGES and GRAPH_NEIGHBORS --- js/server/modules/org/arangodb/aql.js | 7 ++++++- js/server/tests/aql-general-graph.js | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/js/server/modules/org/arangodb/aql.js b/js/server/modules/org/arangodb/aql.js index 9a00bd9f28..2a426d3411 100644 --- a/js/server/modules/org/arangodb/aql.js +++ b/js/server/modules/org/arangodb/aql.js @@ -5825,7 +5825,9 @@ function AQL_NEIGHBORS (vertexCollection, /// depth a path to a neighbor must have to be returned (default is 1). /// * *maxDepth* : Defines the maximal /// depth a path to a neighbor must have to be returned (default is 1). -/// +/// * *maxIterations*: the maximum number of iterations that the traversal is +/// allowed to perform. It is sensible to set this number so unbounded traversals +/// will terminate at some point. /// @EXAMPLES /// /// A route planner example, all neighbors of locations with a distance of either @@ -5875,6 +5877,7 @@ function AQL_GRAPH_NEIGHBORS (graphName, factory = TRAVERSAL.generalGraphDatasourceFactory(graphName); params.minDepth = options.minDepth === undefined ? 1 : options.minDepth; params.maxDepth = options.maxDepth === undefined ? 1 : options.maxDepth; + params.maxIterations = options.maxIterations; params.paths = true; params.visitor = TRAVERSAL_NEIGHBOR_VISITOR; var fromVertices = RESOLVE_GRAPH_TO_FROM_VERTICES(graphName, options); @@ -5946,6 +5949,8 @@ function AQL_GRAPH_NEIGHBORS (graphName, /// * *maxDepth* : Defines the maximal length of a path from an edge /// to a vertex (default is 1, which means only the edges directly connected to a vertex would /// be returned). +/// * *maxIterations*: the maximum number of iterations that the traversal is +/// allowed to perform. It is sensible to set this number so unbounded traversals /// /// @EXAMPLES /// diff --git a/js/server/tests/aql-general-graph.js b/js/server/tests/aql-general-graph.js index bc4d5a6ca4..1cff145980 100644 --- a/js/server/tests/aql-general-graph.js +++ b/js/server/tests/aql-general-graph.js @@ -439,7 +439,8 @@ function ahuacatlQueryGeneralEdgesTestSuite() { name: gN, example: v1 + "/v1", options: { - direction : 'any' + direction : 'any', + maxIterations : 10000 } }; var actual = getRawQueryResults(AQL_NEIGHBORS, bindVars);