arangosh> db._create("vertex");
[ArangoCollection 97718, "vertex" (type document, status loaded)]
arangosh> db._createEdgeCollection("relation");
[ArangoCollection 97724, "relation" (type edge, status loaded)]
arangosh> myGraph.v1 = db.vertex.insert({ name : "vertex 1" });
{
"_id" : "vertex/97731",
"_key" : "97731",
"_rev" : "_XUJy0mC--_"
}
arangosh> myGraph.v2 = db.vertex.insert({ name : "vertex 2" });
{
"_id" : "vertex/97735",
"_key" : "97735",
"_rev" : "_XUJy0mG--_"
}
arangosh> myGraph.e1 = db.relation.insert(myGraph.v1, myGraph.v2,
........> { label : "knows"});
{
"_id" : "relation/97738",
"_key" : "97738",
"_rev" : "_XUJy0mG--B"
}
arangosh> db._document(myGraph.e1);
{
"_key" : "97738",
"_id" : "relation/97738",
"_from" : "vertex/97731",
"_to" : "vertex/97735",
"_rev" : "_XUJy0mG--B",
"label" : "knows"
}
arangosh> db.relation.inEdges(myGraph.v1._id);
[ ]
arangosh> db.relation.inEdges(myGraph.v2._id);
[
{
"_key" : "97738",
"_id" : "relation/97738",
"_from" : "vertex/97731",
"_to" : "vertex/97735",
"_rev" : "_XUJy0mG--B",
"label" : "knows"
}
]