mirror of https://gitee.com/bigwinds/arangodb
41 lines
876 B
Plaintext
41 lines
876 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_DISTANCE_TO("
|
|
........> +"'routeplanner', {}, {}, { " +
|
|
........> " weight : 'distance', endVertexCollectionRestriction : 'germanCity', " +
|
|
........> "startVertexCollectionRestriction : 'frenchCity'}) RETURN [e.startVertex, e.vertex, " +
|
|
........> "e.distance]"
|
|
........> ).toArray();
|
|
[
|
|
[
|
|
"frenchCity/Paris",
|
|
"germanCity/Berlin",
|
|
1
|
|
],
|
|
[
|
|
"frenchCity/Paris",
|
|
"germanCity/Hamburg",
|
|
1
|
|
],
|
|
[
|
|
"frenchCity/Paris",
|
|
"germanCity/Cologne",
|
|
1
|
|
],
|
|
[
|
|
"frenchCity/Lyon",
|
|
"germanCity/Berlin",
|
|
1
|
|
],
|
|
[
|
|
"frenchCity/Lyon",
|
|
"germanCity/Hamburg",
|
|
1
|
|
],
|
|
[
|
|
"frenchCity/Lyon",
|
|
"germanCity/Cologne",
|
|
1
|
|
]
|
|
]
|