arangosh> db._create("vertex");
[ArangoCollection 7503, "vertex" (type document, status loaded)]
arangosh> db._createEdgeCollection("relation");
[ArangoCollection 7506, "relation" (type edge, status loaded)]
arangosh> myGraph.v1 = db.vertex.insert({ name : "vertex 1" });
{
"_id" : "vertex/7510",
"_key" : "7510",
"_rev" : "_XGh-X0u--_"
}
arangosh> myGraph.v2 = db.vertex.insert({ name : "vertex 2" });
{
"_id" : "vertex/7514",
"_key" : "7514",
"_rev" : "_XGh-X0y--_"
}
arangosh> myGraph.e1 = db.relation.insert(myGraph.v1, myGraph.v2,
........> { label : "knows"});
{
"_id" : "relation/7517",
"_key" : "7517",
"_rev" : "_XGh-X02--_"
}
arangosh> db._document(myGraph.e1);
{
"_key" : "7517",
"_id" : "relation/7517",
"_from" : "vertex/7510",
"_to" : "vertex/7514",
"_rev" : "_XGh-X02--_",
"label" : "knows"
}
arangosh> db.relation.outEdges(myGraph.v1._id);
[
{
"_key" : "7517",
"_id" : "relation/7517",
"_from" : "vertex/7510",
"_to" : "vertex/7514",
"_rev" : "_XGh-X02--_",
"label" : "knows"
}
]
arangosh> db.relation.outEdges(myGraph.v2._id);
[ ]