ArangoDB v3.13 is under development and not released yet. This documentation is not final and potentially incomplete.

HTTP interface for edges

The Edge API lets you retrieve the connected edges of a single node, optionally restricted to incoming or outgoing edges

You can use the general Document API to create, read, modify, and delete edge documents. The only difference to working with node documents is that the _from and _to attributes are mandatory and must contain document identifiers.

The Edge API is useful if you want to look up the inbound and outbound edges of a node with low overhead. You can also retrieve edges with AQL queries, but queries need to be parsed and planned, and thus have an overhead. On the other hand, AQL is far more powerful, letting you perform graph traversals, for instance.

Addresses of edges

Edges are a special variation of documents and you can access them like any document. See Addresses of documents for details.

Get inbound and outbound edges

GET /_db/{database-name}/_api/edges/{collection}
Returns an array of edges starting or ending in the node identified by vertex.
Path Parameters
  • The name of the database.

  • The name of the edge collection you want to retrieve edges from.

Query Parameters
  • The document identifier of the start node.

  • Possible values: "any", "in", "out"

    • "in": Return edges that reference the vertex in the _to attribute.
    • "out": Return edges that reference the vertex in the _from attribute.
    • "any": Return edges that reference the vertex in the _from or _to attribute.

HTTP Headers
  • Set this header to true to allow the Coordinator to ask any shard replica for the data, not only the shard leader. This may result in “dirty reads”.

Responses
  • is returned if the edge collection was found and edges were retrieved.

  • is returned if the request contains invalid parameters.

  • is returned if the edge collection was not found.

Examples

Any direction

curl --header 'accept: application/json' --dump - 'http://localhost:8529/_api/edges/edges?vertex=nodes/1'
Show output

In edges

curl --header 'accept: application/json' --dump - 'http://localhost:8529/_api/edges/edges?vertex=nodes/1&direction=in'
Show output

Out edges

curl --header 'accept: application/json' --dump - 'http://localhost:8529/_api/edges/edges?vertex=nodes/1&direction=out'
Show output