mirror of https://gitee.com/bigwinds/arangodb
added custom visitor functionality for GRAPH_NEIGHBORS, too
This commit is contained in:
parent
6fa6516cf0
commit
442b716d75
|
@ -87,6 +87,8 @@ v2.5.0 (XXXX-XX-XX)
|
||||||
v2.4.4 (2015-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
|
* increased default value of traversal option *maxIterations* to 100 times of its previous
|
||||||
default value
|
default value
|
||||||
|
|
||||||
|
|
|
@ -6466,7 +6466,15 @@ function AQL_GRAPH_NEIGHBORS (graphName,
|
||||||
params.maxDepth = options.maxDepth === undefined ? 1 : options.maxDepth;
|
params.maxDepth = options.maxDepth === undefined ? 1 : options.maxDepth;
|
||||||
params.maxIterations = options.maxIterations;
|
params.maxIterations = options.maxIterations;
|
||||||
params.paths = true;
|
params.paths = true;
|
||||||
|
// 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;
|
params.visitor = TRAVERSAL_NEIGHBOR_VISITOR;
|
||||||
|
}
|
||||||
|
|
||||||
var fromVertices = RESOLVE_GRAPH_TO_FROM_VERTICES(graphName, options);
|
var fromVertices = RESOLVE_GRAPH_TO_FROM_VERTICES(graphName, options);
|
||||||
if (options.edgeExamples) {
|
if (options.edgeExamples) {
|
||||||
params.followEdges = options.edgeExamples;
|
params.followEdges = options.edgeExamples;
|
||||||
|
|
Loading…
Reference in New Issue