1
0
Fork 0
arangodb/Documentation/Examples/generalGraphNeighbors2.gene...

281 lines
7.1 KiB
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_NEIGHBORS("
........> +"'routeplanner', 'germanCity/Hamburg', {direction : 'outbound', maxDepth : 2}) RETURN e"
........> ).toArray();
[
{
"vertex" : {
"_id" : "germanCity/Cologne",
"_key" : "Cologne",
"_rev" : "1117900019",
"isCapital" : false,
"population" : 1000000
},
"path" : {
"edges" : [
{
"_id" : "germanHighway/1119407347",
"_key" : "1119407347",
"_rev" : "1119407347",
"_from" : "germanCity/Hamburg",
"_to" : "germanCity/Cologne",
"distance" : 500
}
],
"vertices" : [
{
"_id" : "germanCity/Hamburg",
"_key" : "Hamburg",
"_rev" : "1118096627",
"isCapital" : false,
"population" : 1000000
},
{
"_id" : "germanCity/Cologne",
"_key" : "Cologne",
"_rev" : "1117900019",
"isCapital" : false,
"population" : 1000000
}
]
},
"startVertex" : "germanCity/Hamburg"
},
{
"vertex" : {
"_id" : "frenchCity/Lyon",
"_key" : "Lyon",
"_rev" : "1118489843",
"isCapital" : false,
"population" : 80000
},
"path" : {
"edges" : [
{
"_id" : "germanHighway/1119407347",
"_key" : "1119407347",
"_rev" : "1119407347",
"_from" : "germanCity/Hamburg",
"_to" : "germanCity/Cologne",
"distance" : 500
},
{
"_id" : "internationalHighway/1120849139",
"_key" : "1120849139",
"_rev" : "1120849139",
"_from" : "germanCity/Cologne",
"_to" : "frenchCity/Lyon",
"distance" : 700
}
],
"vertices" : [
{
"_id" : "germanCity/Hamburg",
"_key" : "Hamburg",
"_rev" : "1118096627",
"isCapital" : false,
"population" : 1000000
},
{
"_id" : "germanCity/Cologne",
"_key" : "Cologne",
"_rev" : "1117900019",
"isCapital" : false,
"population" : 1000000
},
{
"_id" : "frenchCity/Lyon",
"_key" : "Lyon",
"_rev" : "1118489843",
"isCapital" : false,
"population" : 80000
}
]
},
"startVertex" : "germanCity/Hamburg"
},
{
"vertex" : {
"_id" : "frenchCity/Paris",
"_key" : "Paris",
"_rev" : "1118686451",
"isCapital" : true,
"population" : 4000000
},
"path" : {
"edges" : [
{
"_id" : "germanHighway/1119407347",
"_key" : "1119407347",
"_rev" : "1119407347",
"_from" : "germanCity/Hamburg",
"_to" : "germanCity/Cologne",
"distance" : 500
},
{
"_id" : "internationalHighway/1121045747",
"_key" : "1121045747",
"_rev" : "1121045747",
"_from" : "germanCity/Cologne",
"_to" : "frenchCity/Paris",
"distance" : 550
}
],
"vertices" : [
{
"_id" : "germanCity/Hamburg",
"_key" : "Hamburg",
"_rev" : "1118096627",
"isCapital" : false,
"population" : 1000000
},
{
"_id" : "germanCity/Cologne",
"_key" : "Cologne",
"_rev" : "1117900019",
"isCapital" : false,
"population" : 1000000
},
{
"_id" : "frenchCity/Paris",
"_key" : "Paris",
"_rev" : "1118686451",
"isCapital" : true,
"population" : 4000000
}
]
},
"startVertex" : "germanCity/Hamburg"
},
{
"vertex" : {
"_id" : "frenchCity/Paris",
"_key" : "Paris",
"_rev" : "1118686451",
"isCapital" : true,
"population" : 4000000
},
"path" : {
"edges" : [
{
"_id" : "internationalHighway/1120455923",
"_key" : "1120455923",
"_rev" : "1120455923",
"_from" : "germanCity/Hamburg",
"_to" : "frenchCity/Paris",
"distance" : 900
}
],
"vertices" : [
{
"_id" : "germanCity/Hamburg",
"_key" : "Hamburg",
"_rev" : "1118096627",
"isCapital" : false,
"population" : 1000000
},
{
"_id" : "frenchCity/Paris",
"_key" : "Paris",
"_rev" : "1118686451",
"isCapital" : true,
"population" : 4000000
}
]
},
"startVertex" : "germanCity/Hamburg"
},
{
"vertex" : {
"_id" : "frenchCity/Lyon",
"_key" : "Lyon",
"_rev" : "1118489843",
"isCapital" : false,
"population" : 80000
},
"path" : {
"edges" : [
{
"_id" : "internationalHighway/1120455923",
"_key" : "1120455923",
"_rev" : "1120455923",
"_from" : "germanCity/Hamburg",
"_to" : "frenchCity/Paris",
"distance" : 900
},
{
"_id" : "frenchHighway/1119735027",
"_key" : "1119735027",
"_rev" : "1119735027",
"_from" : "frenchCity/Paris",
"_to" : "frenchCity/Lyon",
"distance" : 550
}
],
"vertices" : [
{
"_id" : "germanCity/Hamburg",
"_key" : "Hamburg",
"_rev" : "1118096627",
"isCapital" : false,
"population" : 1000000
},
{
"_id" : "frenchCity/Paris",
"_key" : "Paris",
"_rev" : "1118686451",
"isCapital" : true,
"population" : 4000000
},
{
"_id" : "frenchCity/Lyon",
"_key" : "Lyon",
"_rev" : "1118489843",
"isCapital" : false,
"population" : 80000
}
]
},
"startVertex" : "germanCity/Hamburg"
},
{
"vertex" : {
"_id" : "frenchCity/Lyon",
"_key" : "Lyon",
"_rev" : "1118489843",
"isCapital" : false,
"population" : 80000
},
"path" : {
"edges" : [
{
"_id" : "internationalHighway/1120652531",
"_key" : "1120652531",
"_rev" : "1120652531",
"_from" : "germanCity/Hamburg",
"_to" : "frenchCity/Lyon",
"distance" : 1300
}
],
"vertices" : [
{
"_id" : "germanCity/Hamburg",
"_key" : "Hamburg",
"_rev" : "1118096627",
"isCapital" : false,
"population" : 1000000
},
{
"_id" : "frenchCity/Lyon",
"_key" : "Lyon",
"_rev" : "1118489843",
"isCapital" : false,
"population" : 80000
}
]
},
"startVertex" : "germanCity/Hamburg"
}
]