Closed enjoysmath closed 2 years ago
Assuming you want to create a graph if it doesn't already exist and then do something with it, I'd do it like this:
const graph = db.graph("school");
if (!(await graph.exists())) {
/* possibly create collections for the graph and populate them here */
await graph.create(/* graph definition goes here */);
}
// graph now exists and can be used
It looks like you're looking for help with using graphs in general, not specifically how to use the driver though, so I'd recommend checking out the community slack: https://slack.arangodb.com
I can't find example code anywhere on the net and I'm new to JS, so parsing the source code and reverse engineering is too difficult for now.
For example, is the following the proper way?