arangosh> db._create("vertex");
[ArangoCollection 7412, "vertex" (type document, status loaded)]
arangosh> db._createEdgeCollection("relation");
[ArangoCollection 7414, "relation" (type edge, status loaded)]
arangosh> myGraph.v1 = db.vertex.insert({ name : "vertex 1" });
{
"_id" : "vertex/7417",
"_key" : "7417",
"_rev" : "_UWx8LRG---"
}
arangosh> myGraph.v2 = db.vertex.insert({ name : "vertex 2" });
{
"_id" : "vertex/7421",
"_key" : "7421",
"_rev" : "_UWx8LRK---"
}
arangosh> myGraph.e1 = db.relation.insert(myGraph.v1, myGraph.v2,
........> { label : "knows"});
{
"_id" : "relation/7424",
"_key" : "7424",
"_rev" : "_UWx8LRK--_"
}
arangosh> db._document(myGraph.e1);
{
"_key" : "7424",
"_id" : "relation/7424",
"_from" : "vertex/7417",
"_to" : "vertex/7421",
"_rev" : "_UWx8LRK--_",
"label" : "knows"
}
arangosh> db.relation.outEdges(myGraph.v1._id);
[
{
"_key" : "7424",
"_id" : "relation/7424",
"_from" : "vertex/7417",
"_to" : "vertex/7421",
"_rev" : "_UWx8LRK--_",
"label" : "knows"
}
]
arangosh> db.relation.outEdges(myGraph.v2._id);
[ ]