Working with Edges using REST

This is documentation to ArangoDB’s REST interface for edges.

Edges are documents with two additional attributes: _from and _to. These attributes are mandatory and must contain the document-handle of the from and to vertices of an edge.

Use the general document REST api for create/read/update/delete.

Read in- or outbound edges

get edges

GET /_api/edges/{collection-id}

Path Parameters

  • collection-id (required): The id of the collection.

Query Parameters

  • vertex (required): The id of the start vertex.

  • direction (optional): Selects in or out direction for edges. If not set, any edges are returned.

Returns an array of edges starting or ending in the vertex identified by vertex-handle.

Return codes

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

  • 400: is returned if the request contains invalid parameters.

  • 404: is returned if the edge collection was not found.

Examples

Any direction

shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1

HTTP/1.1 OK
keep-alive: timeout=300
x-content-type-options: nosniff
content-type: application/json

Show response body

In edges

shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1&direction=in

HTTP/1.1 OK
keep-alive: timeout=300
x-content-type-options: nosniff
content-type: application/json

Show response body

Out edges

shell> curl --header 'accept: application/json' --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1&direction=out

HTTP/1.1 OK
keep-alive: timeout=300
x-content-type-options: nosniff
content-type: application/json

Show response body