Can somebody help me with following issue.
I'm writing custom FOXX app in ArangoDB and I need to create edge collection.
With db._create("example");
I can create document collection, but I don't know how to change the type of it. I've tried db._create("example", {type: "edge"});
but it doesn't work.
In documentation is written
Collections have a type that is specified by the user when the collection is created. There are currently two types: document and edge. The default type is document.
How can I achieve that?
Edges in ArangoDB are special documents. In addition to the system attributes _key, _id and _rev, they have the attributes _from and _to, which contain document handles, namely the start-point and the end-point of the edge.
Joi is a validation library that is used throughout Foxx to define schemas and parameter types.
Foxx is a JavaScript framework for writing data-centric HTTP microservices that run directly inside of ArangoDB.
db._createEdgeCollection("example");
Should solve your problem.
I suggest using the cheat sheet: https://www.arangodb.org/manuals/current/shell_reference_card.pdf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With