arangosh> db._create("vertex");
[ArangoCollection 7460, "vertex" (type document, status loaded)]
arangosh> db._createEdgeCollection("relation");
[ArangoCollection 7463, "relation" (type edge, status loaded)]
arangosh> var myGraph = {};
arangosh> myGraph.v1 = db.vertex.insert({ name : "vertex 1" });
{
"_id" : "vertex/7467",
"_key" : "7467",
"_rev" : "_XGh-XbG--_"
}
arangosh> myGraph.v2 = db.vertex.insert({ name : "vertex 2" });
{
"_id" : "vertex/7471",
"_key" : "7471",
"_rev" : "_XGh-XbO--_"
}
arangosh> myGraph.e1 = db.relation.insert(myGraph.v1, myGraph.v2,
........> { label : "knows"});
{
"_id" : "relation/7474",
"_key" : "7474",
"_rev" : "_XGh-XbS--_"
}
arangosh> db._document(myGraph.e1);
{
"_key" : "7474",
"_id" : "relation/7474",
"_from" : "vertex/7467",
"_to" : "vertex/7471",
"_rev" : "_XGh-XbS--_",
"label" : "knows"
}
arangosh> db.relation.edges(myGraph.e1._id);
[ ]