arangosh> db._create("vertex");
[ArangoCollection 7466, "vertex" (type document, status loaded)]
arangosh> db._createEdgeCollection("relation");
[ArangoCollection 7469, "relation" (type edge, status loaded)]
arangosh> var myGraph = {};
arangosh> myGraph.v1 = db.vertex.insert({ name : "vertex 1" });
{
"_id" : "vertex/7473",
"_key" : "7473",
"_rev" : "_WnWWt2K--_"
}
arangosh> myGraph.v2 = db.vertex.insert({ name : "vertex 2" });
{
"_id" : "vertex/7477",
"_key" : "7477",
"_rev" : "_WnWWt2O--_"
}
arangosh> myGraph.e1 = db.relation.insert(myGraph.v1, myGraph.v2,
........> { label : "knows"});
{
"_id" : "relation/7480",
"_key" : "7480",
"_rev" : "_WnWWt2S--_"
}
arangosh> db._document(myGraph.e1);
{
"_key" : "7480",
"_id" : "relation/7480",
"_from" : "vertex/7473",
"_to" : "vertex/7477",
"_rev" : "_WnWWt2S--_",
"label" : "knows"
}
arangosh> db.relation.edges(myGraph.e1._id);
[ ]