mirror of https://gitee.com/bigwinds/arangodb
35 lines
704 B
Plaintext
35 lines
704 B
Plaintext
arangosh> var graph_module = require("org/arangodb/general-graph");
|
|
arangosh> directed_relation = graph_module._relation("lives_in", "user", "city");
|
|
{
|
|
"collection" : "lives_in",
|
|
"from" : [
|
|
"user"
|
|
],
|
|
"to" : [
|
|
"city"
|
|
]
|
|
}
|
|
arangosh> undirected_relation = graph_module._relation("knows", "user", "user");
|
|
{
|
|
"collection" : "knows",
|
|
"from" : [
|
|
"user"
|
|
],
|
|
"to" : [
|
|
"user"
|
|
]
|
|
}
|
|
arangosh> edgedefinitions = graph_module._edgeDefinitions(directed_relation);
|
|
[
|
|
{
|
|
"collection" : "lives_in",
|
|
"from" : [
|
|
"user"
|
|
],
|
|
"to" : [
|
|
"city"
|
|
]
|
|
}
|
|
]
|
|
arangosh> edgedefinitions = graph_module._extendEdgeDefinitions(undirected_relation);
|