arangosh> db._create("vertex");
[ArangoCollection 111169096, "vertex" (type document, status loaded)]
arangosh> db._createEdgeCollection("relation");
[ArangoCollection 111300168, "relation" (type edge, status loaded)]
arangosh> myGraph.v1 = db.vertex.insert({ name : "vertex 1" });
{
"_id" : "vertex/111627848",
"_rev" : "111627848",
"_key" : "111627848"
}
arangosh> myGraph.v2 = db.vertex.insert({ name : "vertex 2" });
{
"_id" : "vertex/111824456",
"_rev" : "111824456",
"_key" : "111824456"
}
arangosh> myGraph.e1 = db.relation.insert(myGraph.v1, myGraph.v2,
........> { label : "knows"});
{
"_id" : "relation/112152136",
"_rev" : "112152136",
"_key" : "112152136"
}
arangosh> db._document(myGraph.e1);
{
"label" : "knows",
"_from" : "vertex/111627848",
"_id" : "relation/112152136",
"_key" : "112152136",
"_rev" : "112152136",
"_to" : "vertex/111824456"
}
arangosh> db.relation.outEdges(myGraph.v1._id);
[
{
"label" : "knows",
"_id" : "relation/112152136",
"_rev" : "112152136",
"_key" : "112152136",
"_from" : "vertex/111627848",
"_to" : "vertex/111824456"
}
]
arangosh> db.relation.outEdges(myGraph.v2._id);
[ ]