1
0
Fork 0
arangodb/Documentation/Examples/generalGraphModuleDistanceT...

75 lines
1.9 KiB
Plaintext

arangosh> var examples = require("org/arangodb/graph-examples/example-graph.js");
arangosh> var g = examples.loadGraph("routeplanner");
arangosh> g._distanceTo({}, {}, {weight : 'distance', endVertexCollectionRestriction : 'frenchCity',
........> startVertexCollectionRestriction : 'germanCity'});
[
[
{
"startVertex" : "germanCity/Berlin",
"distance" : 1200,
"vertex" : {
"_id" : "frenchCity/Paris",
"_key" : "Paris",
"_rev" : "630941122",
"isCapital" : true,
"population" : 4000000
}
},
{
"startVertex" : "germanCity/Berlin",
"distance" : 1100,
"vertex" : {
"_id" : "frenchCity/Lyon",
"_key" : "Lyon",
"_rev" : "630744514",
"isCapital" : false,
"population" : 80000
}
},
{
"startVertex" : "germanCity/Hamburg",
"distance" : 900,
"vertex" : {
"_id" : "frenchCity/Paris",
"_key" : "Paris",
"_rev" : "630941122",
"isCapital" : true,
"population" : 4000000
}
},
{
"startVertex" : "germanCity/Hamburg",
"distance" : 1200,
"vertex" : {
"_id" : "frenchCity/Lyon",
"_key" : "Lyon",
"_rev" : "630744514",
"isCapital" : false,
"population" : 80000
}
},
{
"startVertex" : "germanCity/Cologne",
"distance" : 700,
"vertex" : {
"_id" : "frenchCity/Lyon",
"_key" : "Lyon",
"_rev" : "630744514",
"isCapital" : false,
"population" : 80000
}
},
{
"startVertex" : "germanCity/Cologne",
"distance" : 550,
"vertex" : {
"_id" : "frenchCity/Paris",
"_key" : "Paris",
"_rev" : "630941122",
"isCapital" : true,
"population" : 4000000
}
}
]
]