arangosh> db._create("vertex");
[ArangoCollection 65435, "vertex" (type document, status loaded)]
arangosh> db._createEdgeCollection("relation");
[ArangoCollection 65440, "relation" (type edge, status loaded)]
arangosh> myGraph.v1 = db.vertex.insert({ name : "vertex 1" });
{
"_id" : "vertex/65447",
"_key" : "65447",
"_rev" : "_ZG8LcQW---"
}
arangosh> myGraph.v2 = db.vertex.insert({ name : "vertex 2" });
{
"_id" : "vertex/65449",
"_key" : "65449",
"_rev" : "_ZG8LcQW--A"
}
arangosh> myGraph.e1 = db.relation.insert(myGraph.v1, myGraph.v2,
........> { label : "knows"});
{
"_id" : "relation/65451",
"_key" : "65451",
"_rev" : "_ZG8LcQW--C"
}
arangosh> db._document(myGraph.e1);
{
"_key" : "65451",
"_id" : "relation/65451",
"_from" : "vertex/65447",
"_to" : "vertex/65449",
"_rev" : "_ZG8LcQW--C",
"label" : "knows"
}
arangosh> db.relation.outEdges(myGraph.v1._id);
[
{
"_key" : "65451",
"_id" : "relation/65451",
"_from" : "vertex/65447",
"_to" : "vertex/65449",
"_rev" : "_ZG8LcQW--C",
"label" : "knows"
}
]
arangosh> db.relation.outEdges(myGraph.v2._id);
[ ]