1
0
Fork 0

added custom visitor functionality for GRAPH_NEIGHBORS, too

This commit is contained in:
Jan Steemann 2015-02-11 12:55:21 +01:00
parent 6fa6516cf0
commit 442b716d75
2 changed files with 11 additions and 1 deletions

View File

@ -87,6 +87,8 @@ v2.5.0 (XXXX-XX-XX)
v2.4.4 (2015-XX-XX)
-------------------
* add custom visitor functionality for `GRAPH_NEIGHBORS` function, too
* increased default value of traversal option *maxIterations* to 100 times of its previous
default value

View File

@ -6466,7 +6466,15 @@ function AQL_GRAPH_NEIGHBORS (graphName,
params.maxDepth = options.maxDepth === undefined ? 1 : options.maxDepth;
params.maxIterations = options.maxIterations;
params.paths = true;
params.visitor = TRAVERSAL_NEIGHBOR_VISITOR;
// add user-defined visitor, if specified
if (typeof options.visitor === "string") {
params.visitorReturnsResults = options.visitorReturnsResults || false;
params.visitor = GET_VISITOR(options.visitor, options);
}
else {
params.visitor = TRAVERSAL_NEIGHBOR_VISITOR;
}
var fromVertices = RESOLVE_GRAPH_TO_FROM_VERTICES(graphName, options);
if (options.edgeExamples) {
params.followEdges = options.edgeExamples;