1
0
Fork 0
arangodb/Documentation/Books/Users/ModuleGraph
Jan Steemann d92057dd03 the great rename: array => object, list => array 2014-12-18 22:33:23 +01:00
..
EdgeMethods.mdpp Changed text for deprecated files 2014-11-20 16:39:16 +01:00
GraphConstructor.mdpp the great rename: array => object, list => array 2014-12-18 22:33:23 +01:00
README.mdpp Changed text for deprecated files 2014-11-20 16:39:16 +01:00
VertexMethods.mdpp the great rename: array => object, list => array 2014-12-18 22:33:23 +01:00

README.mdpp

!CHAPTER Module "graph"

**Warning: This Chapter is Deprecated**

!SUBSECTION First Steps with Graphs

A Graph consists of vertices and edges. The vertex collection contains the
documents forming the vertices. The [edge collection](../Glossary/README.html#edge_collection) contains the documents
forming the edges. Together both collections form a graph. Assume that the
vertex collection is called *vertices* and the edges collection *edges*, then
you can build a graph using the *Graph* constructor.

```js
arango> var Graph = require("org/arangodb/graph").Graph;

arango> g1 = new Graph("graph", "vertices", "edges");
Graph("vertices", "edges")
```
It is possible to use different edges with the same vertices. For instance, to
build a new graph with a different edge collection use

```js
arango> var Graph = require("org/arangodb/graph").Graph;

arango> g2 = new Graph("graph", "vertices", "alternativeEdges");
Graph("vertices", "alternativeEdges")
```

It is, however, impossible to use different vertices with the same edges. Edges
are tied to the vertices.