mirror of https://gitee.com/bigwinds/arangodb
48 lines
805 B
Plaintext
48 lines
805 B
Plaintext
arangosh> var examples = require("org/arangodb/graph-examples/example-graph.js");
|
|
arangosh> var g = examples.loadGraph("routeplanner");
|
|
arangosh> db._query("FOR e IN GRAPH_SHORTEST_PATH("
|
|
........> + "'routeplanner', {}, {}, {" +
|
|
........> "weight : 'distance', endVertexCollectionRestriction : 'frenchCity', " +
|
|
........> "includeData: true, " +
|
|
........> "startVertexCollectionRestriction : 'germanCity'}) RETURN [e.startVertex, e.vertex._id, " +
|
|
........> "e.distance, LENGTH(e.paths)]"
|
|
........> ).toArray();
|
|
[
|
|
[
|
|
null,
|
|
null,
|
|
1,
|
|
0
|
|
],
|
|
[
|
|
null,
|
|
null,
|
|
1,
|
|
0
|
|
],
|
|
[
|
|
null,
|
|
null,
|
|
1,
|
|
0
|
|
],
|
|
[
|
|
null,
|
|
null,
|
|
1,
|
|
0
|
|
],
|
|
[
|
|
null,
|
|
null,
|
|
1,
|
|
0
|
|
],
|
|
[
|
|
null,
|
|
null,
|
|
1,
|
|
0
|
|
]
|
|
]
|