Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating edge collection in ArangoDb FOXX app

Tags:

arangodb

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?

like image 967
Jakub Riedl Avatar asked Dec 16 '13 13:12

Jakub Riedl


People also ask

What is EDGE ArangoDB?

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.

What is the validation library that comes bundled with Foxx?

Joi is a validation library that is used throughout Foxx to define schemas and parameter types.

What is Foxx ArangoDB?

Foxx is a JavaScript framework for writing data-centric HTTP microservices that run directly inside of ArangoDB.


1 Answers

db._createEdgeCollection("example");

Should solve your problem.

I suggest using the cheat sheet: https://www.arangodb.org/manuals/current/shell_reference_card.pdf

like image 180
mchacki Avatar answered Sep 19 '22 11:09

mchacki