1
0
Fork 0
arangodb/Documentation/Examples/general_graph_create_graph_...

12 lines
667 B
Plaintext

arangosh> var graph_module = require("org/arangodb/general-graph");
arangosh> var edgeDefinitions = graph_module._edgeDefinitions();
arangosh> graph_module._extendEdgeDefinitions(edgeDefinitions, graph_module._relation("friend_of", "Customer", "Customer"));
arangosh> graph_module._extendEdgeDefinitions(
........> edgeDefinitions, graph_module._relation(
........> "has_bought", ["Customer", "Company"], ["Groceries", "Electronics"]));
arangosh> graph_module._create("myStore", edgeDefinitions);
[ Graph myStore EdgeDefinitions: [
"friend_of: [Customer] -> [Customer]",
"has_bought: [Company, Customer] -> [Electronics, Groceries]"
] VertexCollections: [ ] ]