arangosh> db._create("vertex");
[ArangoCollection 7701, "vertex" (type document, status loaded)]
arangosh> db._createEdgeCollection("relation");
[ArangoCollection 7703, "relation" (type edge, status loaded)]
arangosh> myGraph.v1 = db.vertex.insert({ name : "vertex 1" });
{
"_id" : "vertex/7706",
"_key" : "7706",
"_rev" : "7706"
}
arangosh> myGraph.v2 = db.vertex.insert({ name : "vertex 2" });
{
"_id" : "vertex/7710",
"_key" : "7710",
"_rev" : "7710"
}
arangosh> myGraph.e1 = db.relation.insert(myGraph.v1, myGraph.v2,
........> { label : "knows"});
{
"_id" : "relation/7713",
"_key" : "7713",
"_rev" : "7713"
}
arangosh> db._document(myGraph.e1);
{
"_key" : "7713",
"_id" : "relation/7713",
"_from" : "vertex/7706",
"_to" : "vertex/7710",
"_rev" : "7713",
"label" : "knows"
}
arangosh> db.relation.inEdges(myGraph.v1._id);
[ ]
arangosh> db.relation.inEdges(myGraph.v2._id);
[
{
"_key" : "7713",
"_id" : "relation/7713",
"_from" : "vertex/7706",
"_to" : "vertex/7710",
"_rev" : "7713",
"label" : "knows"
}
]