diff --git a/js/server/modules/org/arangodb/aql.js b/js/server/modules/org/arangodb/aql.js index 6ce9af6f23..22366fed6f 100644 --- a/js/server/modules/org/arangodb/aql.js +++ b/js/server/modules/org/arangodb/aql.js @@ -5910,7 +5910,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 @@ -5960,6 +5962,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); @@ -6031,6 +6034,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);