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