I have the following two collections in arangoDB, airports which are the vertices and flights which are the edges.
I would like to create a graph out of them, through the command line. I have found upon the following code, which should do that, but when I click on the graph( that gets successfully created ) in the interface it shows me different graph views. Sometimes with many/different number of nodes and edges and sometimes with one node.
I have no idea why it behaves that way, or if the following code is actually good ?
Any expert in ArangoDB ?
var graph_module = require("@arangodb/general-graph");
var graph = graph_module._create("flightFliesToAirport");
graph;
[ Graph flightFliesToAirport EdgeDefinitions: [ ] VertexCollections: [ ] ]
graph._addVertexCollection("airports");
graph;
[ Graph flightFliesToAirport EdgeDefinitions: ["flights"] VertexCollections: [
"airports",
] ]
var rel = graph_module._relation("flights" , ["airports"], ["airports"]);
graph._extendEdgeDefinitions(rel);
graph;
[ Graph flightFliesToAirport EdgeDefinitions: [
"flights: [airports] -> [airports]"
] VertexCollections: [ ] ]