diff --git a/js/server/modules/org/arangodb/ahuacatl.js b/js/server/modules/org/arangodb/ahuacatl.js index d067636e02..08b127b1af 100644 --- a/js/server/modules/org/arangodb/ahuacatl.js +++ b/js/server/modules/org/arangodb/ahuacatl.js @@ -5949,11 +5949,14 @@ function GENERAL_GRAPH_EDGES ( var neighbors = GENERAL_GRAPH_NEIGHBORS(graphName, vertexExample, - options), result = []; + options), result = [],ids = []; neighbors.forEach(function (n) { n.path.edges.forEach(function (e) { - result = result.concat(e); + if (ids.indexOf(e._id) === -1) { + result.push(e); + ids.push(e._id); + } }); }); diff --git a/js/server/tests/ahuacatl-general-graph.js b/js/server/tests/ahuacatl-general-graph.js index 31578a0c4a..399929cf7d 100644 --- a/js/server/tests/ahuacatl-general-graph.js +++ b/js/server/tests/ahuacatl-general-graph.js @@ -132,14 +132,11 @@ function ahuacatlQueryGeneralEdgesTestSuite() { actual = getQueryResults("FOR e IN GRAPH_EDGES('bla3', [{hugo : true}, {heinz : 1}], {direction : 'any'}) " + "SORT e.what RETURN e.what"); assertEqual(actual, [ "v1->v2", - "v1->v2", "v1->v5", "v2->v1", - "v2->v1", "v2->v5", "v3->v5", "v3->v6", - "v3->v8", "v3->v8" ]); actual = getRawQueryResults("FOR e IN GRAPH_VERTICES('bla3', [{hugo : true}, {heinz : 1}], {direction : 'any'}) SORT e._id RETURN e");