1
0
Fork 0

distinct result on GRAPH_EDGES

This commit is contained in:
scottashton 2014-07-08 08:35:37 +02:00
parent b67a016b4c
commit 90e4bf9bd3
2 changed files with 5 additions and 5 deletions

View File

@ -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);
}
});
});

View File

@ -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");